/* ======================================
   MAIN STYLES - Dex Card Maker
   ======================================
   Core styles, resets, default variables,
   base layout, and default element styling.
   ====================================== */

/* ---- 1. CORE SETUP & VARIABLES (Default: BallsDex Blue Theme) ---- */
:root {
    /* Colors - BallsDex (Blue) Theme */
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-primary-light: #60a5fa;
    --color-primary-dark: #1d4ed8;
    --color-primary-glow: rgba(59, 130, 246, 0.5);
    --color-white: #ffffff; /* Added for clarity */

    /* UI Colors */
    --color-bg-dark: #1a1a2e;
    --color-bg-medium: #171a2a;
    --color-bg-panel: rgba(13, 13, 43, 0.6);
    --color-bg-header: rgba(37, 99, 235, 0.5); /* Default blue header */
    --color-text-light: #e6e6e6;
    --color-text-medium: #ccc;
    --color-text-subtle: #bbb;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #ffcc00;
    --color-stat-health: #FF6B6B;
    --color-stat-attack: #FFD700;

    /* Borders & Shadows */
    --color-border-light: rgba(255, 255, 255, 0.1);
    --color-border-medium: rgba(255, 255, 255, 0.2);
    --color-border-dashed: rgba(255, 255, 255, 0.5);
    --shadow-card: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-neon-blue: 0 0 5px rgba(59, 130, 246, 0.5), 0 0 10px rgba(59, 130, 246, 0.4), 0 0 15px rgba(59, 130, 246, 0.3);

    /* Sizing */
    --radius-small: 5px;
    --radius-medium: 8px;
    --radius-large: 10px;
    --radius-card: 15px;
    --card-aspect-ratio: 140%; /* 7:5 aspect ratio */
    --scrollbar-width: 8px;

    /* Fonts */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-card-header: 'Arsenica Extrabold', sans-serif;
    --font-card-ability-name: 'Bobby Jones Soft', sans-serif ;
    --font-card-ability-desc: 'Open Sans Semibold', sans-serif;
    --font-card-stats: 'Bobby Jones Soft', sans-serif;

    /* Animations */
    --transition-fast: all 0.2s ease;
    --transition-medium: all 0.3s ease;
}

/* ---- 2. FONT DEFINITIONS ---- */
@font-face {
    font-family: 'Arsenica Extrabold';
    src: url('../fonts/ArsenicaTrial-Extrabold.ttf') format('truetype');
    font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Bobby Jones Soft';
    src: url('../fonts/Bobby Jones Soft.otf') format('opentype');
    font-weight: normal; font-style: normal; font-display: swap;

}
@font-face {
    font-family: 'Open Sans Semibold';
    src: url('../fonts/OpenSans-Semibold.ttf') format('truetype');
    font-weight: 600; font-style: normal; font-display: swap;
}

/* ---- 3. BASE STYLES & RESETS ---- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-height: 100vh; /* Prevent body scrolling by default */
    overflow: hidden; /* Prevent body scrolling by default */
    line-height: 1.6;
    /* Default theme class */
    /* The JS will add theme-historydex or theme-ballsdex as needed */
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover, a:focus {
    color: var(--color-primary-hover);
    text-decoration: underline;
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Base Form Elements */
input, select, textarea, button {
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text-light);
    border: 1px solid var(--color-border-medium);
    background-color: var(--color-bg-panel);
    border-radius: var(--radius-small);
    padding: 10px 12px;
    transition: var(--transition-medium);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary-glow);
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23cccccc' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1em;
    padding-right: 35px;
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button {
    cursor: pointer;
    border: none;
}

.hidden {
    display: none !important;
}

/* ---- 4. BASE TAB NAVIGATION ---- */
.tab-container {
    display: flex;
    justify-content: center;
    padding: 8px 0;
    background-color: rgba(13, 13, 43, 0.9);
    border-bottom: 1px solid var(--color-border-light);
    flex-wrap: wrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky; /* Made sticky in enhanced.css */
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.tab-btn {
    padding: 10px 25px;
    margin: 0 5px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-medium);
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    transition: var(--transition-medium);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tab-btn:hover {
    color: var(--color-text-light);
    border-bottom-color: var(--color-primary-hover); /* Default hover */
}

.tab-btn.active {
    color: var(--color-white);
    border-bottom-color: var(--color-primary); /* Default active */
}

/* ---- 5. BASE LAYOUT STRUCTURE ---- */
.container {
    flex: 1;
    overflow: hidden; /* Prevents container scroll, columns scroll internally */
    display: grid;
    /* Grid setup adjusted in enhanced.css */
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); /* Default grid */
    gap: 20px;
    width: 95%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 15px;
    height: calc(100vh - 55px); /* Adjust based on final tab container height */
}

.left-column-area {
    display: flex;
    flex-direction: row;
    gap: 20px;
    height: 100%;
    max-height: calc(100vh - 80px); /* Approximate max height */
    overflow: hidden; /* Prevent this area from scrolling */
}

.input-container {
    background-color: var(--color-bg-panel);
    border-radius: var(--radius-card);
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto; /* Allow this column to scroll */
    height: 100%;
    max-height: calc(100vh - 80px); /* Approximate max height */
}

#logo {
    max-width: 150px;
    margin: 0 auto 15px;
    filter: drop-shadow(0 0 8px var(--color-primary-glow)); /* Default glow */
}

.section-title {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    margin: 5px 0 15px;
    color: var(--color-text-light);
    text-align: center;
    text-shadow: 0 0 8px var(--color-primary-glow); /* Default glow */
}

/* ---- 6. BASE LAYER MANAGER STRUCTURE ---- */
.layer-manager {
    /* Layout adjusted in enhanced.css */
    padding: 15px;
    background-color: rgba(13, 13, 43, 0.5);
    border-radius: var(--radius-large);
    border: 1px solid var(--color-border-light);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100vh - 80px); /* Approximate max height */
    overflow-y: auto; /* Allow layer manager content to scroll */
}

.layer-manager-title {
    text-align: center;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: var(--color-text-medium);
    font-weight: 600;
}

/* Placeholder for layer list - detailed styling in enhanced.css */
.layer-list-display {
    min-height: 150px; /* Ensure some space */
    margin-bottom: 10px;
    /* Enhanced styling in enhanced.css */
}

/* Placeholder for active layer controls */
.active-layer-controls-container {
    margin-bottom: 15px;
    /* Enhanced styling in enhanced.css */
}

/* Base layer controls section */
.layer-controls {
    margin-top: 15px;
    border-top: 1px solid var(--color-border-light);
    padding-top: 15px;
}

/* ---- 7. BASE CARD PREVIEW STRUCTURE ---- */
.card-preview-upload-area {
    /* Layout adjusted in enhanced.css */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    height: 100%;
    overflow-y: auto; /* Allow this area to scroll if needed */
}

.card-preview-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centering and height adjusted in enhanced.css */
}

.card-wrapper {
    width: 100%;
    max-width: 550px; /* Default max width */
    margin: 0 auto 20px; /* Default margin */
    position: relative;
    /* Background, padding, shadow added in enhanced.css */
}

/* Base Card & Layers Structure */
#card {
    position: relative;
    width: 100%;
    height: 0; /* Height controlled by padding-bottom */
    padding-bottom: var(--card-aspect-ratio);
    border-radius: var(--radius-card);
    overflow: visible; /* Allows potential overflow effects */
    background: var(--color-bg-medium); /* Fallback background */
    transform-origin: top left;
    display: block !important; /* Ensure visibility */
}

/* Base style for direct children (layers) */
#card > div {
    position: absolute !important; /* Force absolute positioning */
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: var(--radius-card); /* Inherit border-radius */
}

/* Base Layer Z-index and roles */
#card-background-layer { z-index: 0; }
.main-image-container { z-index: 1; overflow: hidden; }
#card-template-overlay { z-index: 2; pointer-events: none; background-size: 100% 100% !important; }
.ballsdex-card { z-index: 3; pointer-events: none; user-select: none; overflow: hidden; } /* Keep overflow hidden for text container */
#second-card-layer { z-index: 4; pointer-events: none; display: none; opacity: 0.5; }

/* Card Elements Positioning & Base Styling */
/* Positions adjusted to better match reference image */
.card-header {
    position: absolute;
    top: 3%; /* Adjusted */
    left: 5%;
    right: 15%;
    height: 10%; /* Keep height relative */
    display: flex;
    align-items: center;
    overflow: visible; /* Allow text to overflow initially for scaling */
}
.country-name {
    font-family: var(--font-card-header);
    font-weight: 800;
    color: var(--color-white);
    margin: 0;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
    white-space: nowrap; /* Start as single line */
    width: 100%; /* Allow full width for scaling check */
    height: auto;
    line-height: 1.1;
    display: block; /* Use block for width */
    /* Base font size can be adjusted here if needed, e.g., font-size: clamp(24px, 7vw, 48px); */
}

.top-right-icon {
    position: absolute;
    top: 2%; /* Adjusted */
    right: 4%;
    right: 4%;
    width: 15%; /* Slightly smaller */
    height: 10%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: none; /* Managed by JS */
}

.ability-container {
    position: absolute;
    top: 52%;
    left: 4%;
    right: 3%;
    height: 25%;
    box-sizing: border-box;
  }
.ability-name {
    position: absolute;
    top: 0%;
    left: 1%;
    font-family: var(--font-card-ability-name);
    font-weight: normal;
    color: var(--color-white);
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.7);
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 6%);
    height: auto;
    line-height: 1.1;
  }
  
  .ability-description {
    position: absolute;
    top: 45%;
    left: -1%;
    right: 3%;
    bottom: 5%;
    font-family: var(--font-card-ability-desc);
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    text-shadow: 2px 1px 3px rgba(0, 0, 0, 0.6);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
    color: var(--color-white);
    display: block;
  }
  

.card-footer {
    position: absolute;
    bottom: 8%; /* Adjusted slightly higher */
    left: 5%;
    right: 5%;
    height: 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible; /* Allow stats to potentially overflow if needed */
}
.health-container, .attack-container {
    display: flex;
    align-items: center;
    width: 48%;
    overflow: visible;
}
.health-container { justify-content: flex-start; padding-left: 20.5%; } /* Adjusted padding */
.attack-container { justify-content: flex-end; padding-right: 20%; } /* Adjusted padding */
.stat-value {
    font-family: var(--font-card-stats);
    font-size: clamp(20px, 6vw, 36px); /* Adjusted max size */
    font-weight: normal;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    line-height: 1;
    white-space: nowrap; /* Keep stats on one line */
    display: block;
}
.health-container .stat-value { color: var(--color-stat-health); }
.attack-container .stat-value { color: var(--color-stat-attack); }

.credits {
    position: absolute;
    bottom: 3%; /* Adjusted slightly higher */
    left: 1%; /* Adjusted */
    right: 4%; /* Added right boundary */
    line-height: .9;
    display: flex; /* Use flex for better control */
    justify-content: space-between; /* Space out elements */
    overflow: hidden; /* Hide overflow */
    white-space: nowrap;
    text-align: left;
}
.credits div {
    font-family: Arial, sans-serif;
    font-size: clamp(5px, 1.8vw, 12px); /* Adjusted size */
    font-weight: normal;
    color: rgba(0, 0, 0, 0.8);
    text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.9);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}
.credits .creator { display: block; text-align: left; flex-shrink: 1; }
.credits .link { display: block; text-align: left; flex-shrink: 1; }
.credits .artwork { display: block; text-align: left; flex-shrink: 1; } /* Make artwork visible by default, JS can hide if needed */


/* ---- 8. BASE IMAGE UPLOAD SECTION ---- */
.img-upload-section {
    width: 100%;
    max-width: 400px; /* Default max width */
    margin: 10px auto 0;
}

.img-upload-section h3 {
    text-align: center;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: var(--color-text-medium);
    font-weight: 600;
}

.img-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.img-drop, .img-drop-secondary {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(23, 26, 42, 0.7);
    border: 2px dashed var(--color-border-dashed);
    border-radius: var(--radius-large);
    padding: 15px 10px;
    min-height: 90px;
    cursor: pointer;
    transition: var(--transition-medium);
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-subtle);
    overflow: visible;
    z-index: 10; /* Ensure drop targets are clickable */
}

.img-drop .drop-icon, .img-drop-secondary .drop-icon {
    font-size: 26px;
    margin-bottom: 8px;
}

/* Hover, active, has-image states styled in enhanced.css */

/* ---- 9. BASE BUTTONS ---- */
.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    max-width: 400px; /* Default max width */
}

.action-button {
    padding: 10px 15px;
    border: none;
    border-radius: var(--radius-medium);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-medium);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    position: relative;
    overflow: visible;
}

.action-button:hover, .action-button:focus {
    transform: translateY(-2px);
    outline: none;
}

/* Default Download Button Colors (Blue Theme) */
.download-button-blue {
    color: white;
    flex: 1 1 auto;
    min-width: 100px;
    /* Default background colors */
    background-color: var(--color-primary);
}
.download-button-blue:hover, .download-button-blue:focus {
    background-color: var(--color-primary-hover);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}
/* Specific size button colors */
#download-card-sm-btn { background-color: var(--color-primary-light); }
#download-card-sm-btn:hover, #download-card-sm-btn:focus { background-color: var(--color-primary); box-shadow: 0 5px 15px rgba(96, 165, 250, 0.3); }
#download-card-btn { background-color: var(--color-primary); } /* Medium is default primary */
#download-card-large-btn { background-color: var(--color-primary-dark); }
#download-card-large-btn:hover, #download-card-large-btn:focus { background-color: var(--color-primary-hover); box-shadow: 0 5px 15px rgba(29, 78, 216, 0.4); }

/* Reset Button */
.reset-btn {
    background-color: var(--color-danger);
    color: white;
    margin-top: 20px;
    width: 100%;
}

.reset-btn:hover, .reset-btn:focus {
    background-color: #dc2626; /* Darker red */
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

/* ---- 10. BASE INPUT CONTROLS ---- */
.input-group {
    margin-bottom: 15px; /* Add default spacing */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.95rem;
    display: block;
    color: var(--color-text-medium);
    font-weight: 500;
    margin-bottom: 2px;
}

/* Base Toggle Switch */
.toggle-group {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}
.toggle-group label { margin-bottom: 0; }
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255, 255, 255, 0.2); transition: .4s; border-radius: 34px; }
.toggle-slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .toggle-slider { background-color: var(--color-primary); } /* Default checked color */
input:focus + .toggle-slider { box-shadow: 0 0 1px var(--color-primary); }
input:checked + .toggle-slider:before { transform: translateX(26px); }

/* ---- 11. BASE COLLAPSIBLE SECTIONS ---- */
.collapsible-section {
    background-color: rgba(23, 26, 42, 0.7);
    border-radius: var(--radius-large);
    margin-bottom: 15px;
    overflow: hidden;
    transition: var(--transition-medium);
    border: 1px solid var(--color-border-light);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    background-color: var(--color-bg-header); /* Default blue header */
    transition: background-color 0.2s ease;
    user-select: none;
}

.section-header:hover, .section-header:focus {
    background-color: rgba(37, 99, 235, 0.7); /* Default blue hover */
    outline: none;
}

.section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-light);
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
    line-height: 1;
}

.section-collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.section-collapsed .section-content {
    display: none;
}

.section-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: rgba(13, 13, 43, 0.5);
    border-top: 1px solid var(--color-border-light);
}

/* ---- 12. BASE HELP MODAL ---- */
.format-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    margin-left: 5px;
    font-size: 12px;
    font-weight: bold;
    color: var(--color-text-medium);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--color-border-medium);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    vertical-align: middle;
    line-height: 1;
}

.format-help-btn:hover, .format-help-btn:focus {
    background-color: var(--color-primary); /* Default hover */
    color: white;
    border-color: var(--color-primary);
    outline: none;
    transform: scale(1.1);
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; align-items: center; justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: var(--color-bg-panel);
    margin: auto;
    padding: 25px 30px;
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-large);
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
    color: var(--color-text-light);
}

.modal-close-btn {
    color: var(--color-text-subtle);
    position: absolute; top: 10px; right: 15px;
    font-size: 28px; font-weight: bold; line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close-btn:hover, .modal-close-btn:focus {
    color: var(--color-danger);
    text-decoration: none;
    outline: none;
}

.modal-content h4 {
    margin-top: 0; margin-bottom: 15px;
    color: var(--color-primary); /* Default color */
    text-align: center; font-size: 1.4rem;
}

.modal-content p { margin-bottom: 10px; line-height: 1.5; color: var(--color-text-medium); }
.modal-content ul { list-style: none; padding: 0; margin-bottom: 20px; }
.modal-content li { margin-bottom: 8px; padding: 5px 0; border-bottom: 1px solid var(--color-border-light); }
.modal-content li:last-child { border-bottom: none; }
.modal-content code { background-color: rgba(0,0,0, 0.2); padding: 2px 5px; border-radius: var(--radius-small); font-family: monospace; color: var(--color-warning); }

/* ---- 13. BASE FORMATTING CLASSES ---- */
.text-small, .text-small-preview { font-size: 0.85em; }
.text-big, .text-big-preview { font-size: 1.15em; }

/* ---- 14. BASE DISCORD LINK ---- */
.discord-link {
    position: fixed;
    top: 15px; right: 15px;
    z-index: 1010;
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    background-color:transparent;
    color: white;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: var(--transition-medium);
    text-decoration: none;
}
.discord-link img { width: 30px; height: auto; }
.discord-link:hover, .discord-link:focus {
    background-color: #4752c4; /* Discord purple */
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    outline: none;
}

/* ---- 15. BASE FOOTER ---- */
footer {
    background-color: rgba(13, 13, 43, 0.8);
    color: var(--color-text-subtle);
    text-align: center;
    padding: 3px 10px;
    margin-top: auto; /* Pushes footer down in flex container */
    font-size: 0.85rem;
    border-top: 1px solid var(--color-border-light);
    position: relative; /* Ensure it's part of the flow */
    z-index: 50;
}
.footer-content p { margin: 5px 0; }
.footer-content a { color: var(--color-primary); }
.footer-content a:hover, .footer-content a:focus { color: var(--color-primary-hover); }

/* ---- 16. BASE RESPONSIVE STYLES ---- */
/* Base adjustments for smaller screens */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); /* Adjust ratio */
    }
}

@media (max-width: 992px) {
    body {
        overflow: auto; /* Allow body scroll on smaller screens */
        max-height: none;
    }
    .container {
        display: flex; /* Switch to flex column */
        flex-direction: column;
        grid-template-columns: none;
        height: auto;
        max-height: none;
        overflow: visible; /* Allow container content to determine height */
    }
    .left-column-area {
        flex-direction: column;
        order: 1; /* Show card/layers first */
        width: 100%;
        max-height: none;
        height: auto; /* Allow height based on content */
        overflow: visible;
    }
    .input-container {
        order: 2; /* Show inputs second */
        max-height: none;
        position: static; /* Remove sticky positioning */
        overflow: visible;
        width: 100%;
        height: auto;
    }
}

@media (max-width: 576px) {
    .stat-group {
        grid-template-columns: 1fr; /* Stack stats */
    }
    .tab-btn {
        padding: 6px 10px;
        font-size: 0.9rem;
        margin: 2px;
    }
    .button-group {
        flex-direction: column; /* Stack download buttons */
    }
    .download-button-blue {
        width: 100%;
    }
}
