/* ===================================================================
   CARDS/BASE.CSS
   Base Card Styles, Layout, and Components
   =================================================================== */
/* ===== 37. CARD VARIANTS ===== */

/* ----- 37.1 Large Card (Configs) ----- */
.large-card {
    grid-column: span 2;    /* Span 2 columns */
    grid-row: span 2;      /* Span 2 rows */
    height: 740px;         /* Double height + gap */
    max-width: 660px;      /* Double width + gap */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;  /* Start content from the top */
}

/* ----- 37.2 Single Card Centering ----- */
.single-card {
    grid-column: 1 / -1;   /* Span all columns */
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* ----- 37.3 Single Config Card ----- */
.single-config-card {
    grid-column: 1 / -1;   /* Span all columns */
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== 38. CARD LAYOUT ===== */

/* ----- 38.1 Large Card Body ----- */
.large-card .mod-card-body {
    flex: 1;
    overflow: hidden;       /* Prevent body from scrolling */
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    margin-bottom: 0;
    max-height: none;  /* Override any max-height constraints */
}

/* ----- 38.2 Config Group ----- */
.large-card .config-group,
.config-group {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    flex: 1 1 auto;       /* Allow it to grow and shrink as needed */
    display: flex;
    flex-direction: column;
}

/* ----- 38.3 Last Config Group ----- */
.config-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* ===== 39. CARD COMPONENTS ===== */

/* ----- 39.1 Group Header ----- */
.group-header {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
    padding-bottom: 5px;
    text-transform: uppercase;
}

.config-item {
    margin-bottom: 10px;
}

/* Tag styling for all card types */
/* Base tag styling */
.type-tag,
.config-tag,
.item-tag,
.recipe-tag,
.piece-tag,
.location-tag,
.statuseffect-tag,
.creature-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

/* ===== 40. CARD TAGS ===== */

/* ----- 40.1 Config Tag ----- */
.config-tag {
    background-color: #f1c40f;
    color: #000;
}

/* ----- 40.2 Attack Card Tag ----- */
.mod-card-attack-card {
    background-color: #e74c3c;
    color: white;
    padding: 4px 10px;
    font-size: 12px;
    text-transform: uppercase;
}

/* ===== 41. CARD INTERACTIONS ===== */

/* ----- 41.1 Card Hover Effects ----- */
/* Removed - hover effects handled in grid.css */

/* ===== 42. CARD HEADER ===== */

/* ----- 42.1 Card Header ----- */
.mod-card-header {
    margin-bottom: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 3px;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ----- 42.2 Card Name ----- */
h3.mod-name,
.mod-card h3.mod-name,
.mod-card-header h3.mod-name {
    font-size: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    max-width: 75% !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    will-change: auto !important;
}

/* Ensure links inside card name don't change weight */
.mod-name a,
.mod-name a:hover,
.mod-name a:focus,
.mod-name a:visited {
    font-weight: 600 !important;
    text-decoration: none !important;
}

/* ===== 43. CARD ACTIONS ===== */

/* ----- 43.1 Action Buttons Container ----- */
.card-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* ----- 43.3 Action Buttons (Small Cards Only) ----- */
.mod-card .copy-button,
.mod-card .expand-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    margin: -8px;
    outline: none;
    transition: color 0.2s ease, filter 0.2s ease;
    position: relative;
    z-index: 5;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ----- 43.4 Button Hover States (Small Cards Only) ----- */
.mod-card .copy-button:hover,
.mod-card .expand-button:hover {
    color: var(--card-type-color, rgba(255, 255, 255, 0.9));
    filter: drop-shadow(0 0 8px var(--card-type-color));
    /* Removed scale transform to prevent lift */
}

/* ----- 43.5 Copied State ----- */
.copy-button.copied {
    color: #28a745;
    text-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

/* ===== 45. CARD TYPOGRAPHY ===== */

/* ----- 45.1 Card Name ----- */
.mod-name {
    color: #fff;
    margin: 0;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* ----- 45.2 Mod Type Badge ----- */
.mod-type {
    display: inline-block;
    background-color: #0088cc;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ===== 46. CARD BODY ===== */

/* ----- 46.1 Card Body ----- */
.mod-card-body {
    flex: 1;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;           /* Firefox */
    -ms-overflow-style: none;       /* IE and Edge */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ----- 46.2 Card Body Scrollbar ----- */
.mod-card-body::-webkit-scrollbar {
    display: none;  /* Chrome, Safari, Opera */
}

/* ===== 52. CARD FOOTER ===== */

/* ----- 52.1 Mod Card Footer ----- */
.mod-card-footer {
    margin-top: 8px;
    padding: 6px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ----- 52.2 Source Info ----- */
.source-info {
    text-align: right;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    transform: translateZ(0);
    backface-visibility: hidden;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== 73. CARD COMPONENTS ===== */

/* ----- 73.1 Base Card ----- */
.card {
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ----- 73.2 Card Header ----- */
.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* ----- 73.3 Card Footer ----- */
.card-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ----- 73.4 Card Body ----- */
.card-body {
    padding: 2rem;
    position: relative;
}


