:root {
    /* Color Palette */
    --body-start: #F1E3F3;
    --body-end: #C2BBF0;
    --accent-blue: #8FB8ED;
    --header-bg: #2c3e50;
    --card-bg: rgb(232, 235, 235);
    --success: #10b981;
    --error: #ef4444;
    --text-main: #2c3e50;
    --text-muted: #64748b;
}

/* =========================================
   1. GLOBAL SCALING
   ========================================= */
html { font-size: 14px; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, var(--body-start) 0%, var(--body-end) 100%);
    background-attachment: fixed;
    margin: 0;
    padding-bottom: 40px;
    color: var(--text-main);
}

/* =========================================
   2. GLOBAL VISIBILITY UTILITIES
   ========================================= */
/* Hide Mobile elements by default (Desktop First) */
.mobile-header, .drawer, .mobile-guide {
    display: none !important; 
}

/* Show Desktop elements by default */
.desktop-guide {
    display: block !important;
}

/* =========================================
   3. DESKTOP HEADER & LAYOUT
   ========================================= */
header {
    background-color: var(--header-bg);
    color: white;
    text-align: center;
    padding: 3.5rem 1rem 7.5rem 1rem; 
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

header h1 { font-size: 3.5rem; margin: 0; font-weight: 800; letter-spacing: -1px; }
header p { margin-top: 10px; font-size: 1.2rem; opacity: 0.9; font-weight: 300; }

.nav-wrapper {
    position: sticky; top: 25px; z-index: 1000;
    margin-top: -100px; 
    display: flex; justify-content: center; padding: 0 25px;
}

.filter-nav {
    background: rgb(232, 235, 235);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    padding: 15px 25px; border-radius: 60px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    max-width: 90%; border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn {
    white-space: nowrap; padding: 12px 28px; border: none;
    background: transparent; color: #475569; font-weight: 700;
    font-size: 1rem; border-radius: 50px; cursor: pointer; transition: 0.2s;
}

.btn.active {
    background-color: var(--accent-blue) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(143, 184, 237, 0.5);
}

/* Main Grid Layout */
.container {
    display: grid;
    grid-template-columns: 320px 1fr 280px; 
    gap: 30px; max-width: 1600px;
    margin: 50px auto; padding: 0 30px; align-items: start;
}

/* =========================================
   4. SIDEBARS (DESKTOP)
   ========================================= */
#performance-dashboard {
    position: sticky; top: 120px; 
    display: flex; flex-direction: column; gap: 20px;
    max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: none;
}
#performance-dashboard::-webkit-scrollbar { display: none; }

.dashboard-title {
    color: var(--header-bg); font-size: 1.1rem; font-weight: 800;
    margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px;
}

.stats-card {
    background: var(--card-bg); padding: 20px; border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); transition: 0.3s;
}
.stats-card:hover {
    transform: translateX(8px); border-color: var(--accent-blue);
    background: rgb(232, 235, 235);
}

.stats-info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.stats-label { font-size: 0.85rem; font-weight: 800; color: var(--header-bg); }

.total-badge {
    font-size: 0.8rem; font-weight: 700; color: #2c3e50;
    background: var(--accent-blue); padding: 4px 8px; border-radius: 6px;
}

.stats-detail { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-bottom: 10px; }

.progress-container {
    height: 16px; background: rgba(0, 0, 0, 0.05);
    border-radius: 20px; overflow: hidden;
}
.progress-fill { height: 100%; background: var(--accent-blue); transition: width 0.4s ease; }

.sub-reset-btn {
    margin-top: 15px; width: 100%; padding: 8px;
    font-size: 0.75rem; font-weight: 700;
    background: rgba(255, 255, 255, 0.5); color: var(--error);
    border: 1px solid #fee2e2; border-radius: 10px; cursor: pointer; transition: 0.2s;
}
.sub-reset-btn:hover { background: #fee2e2; }

/* Navigation Sidebar */
#question-navigation {
    position: sticky; top: 120px;
    display: flex; flex-wrap: wrap; gap: 12px;
    background: var(--card-bg); padding: 20px;
    border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.nav-number {
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    background: white; border: 1px solid #e2e8f0; border-radius: 12px;
    font-size: 1.1rem; font-weight: 600; cursor: pointer;
    transition: 0.2s; color: var(--text-main); text-decoration: none;
}
.nav-number:hover { border-color: var(--accent-blue); background: #f0f7ff; }
.nav-number.answered { background-color: var(--accent-blue); color: white; border-color: var(--accent-blue); }

/* =========================================
   5. QUESTION CARDS (GLASS THEME)
   ========================================= */

/* The Main Card Container */
.question-card {
    /* Base Glass Layer: Transparent enough to see the purple background */
    background: rgba(255, 255, 255, 0.25); 
    
    /* The Blur: Frosts the background */
    backdrop-filter: blur(15px);           
    -webkit-backdrop-filter: blur(15px);   
    
    /* Border: A faint white outline */
    border: 1px solid rgba(255, 255, 255, 0.4);
    
    /* Shadow: Soft float effect */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 30px;
}

.question { 
    font-size: 1.4rem; 
    font-weight: 600; 
    line-height: 1.5; 
    margin-top: 0; 
    color: var(--text-main);
    /* Optional: Adds a subtle text shadow for better readability on glass */
    text-shadow: 0 1px 1px rgba(255,255,255,0.5); 
}

.options-container { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    margin-top: 25px; 
}

/* The Answer Buttons (Inner Glass Layer) */
/* =========================================
   UPDATED: OPTION BUTTONS (PERFECT MATCH)
   ========================================= */

.option-item { 
    padding: 18px 25px; 
    
    /* THE FIX: Transparent background makes it look exactly like the card */
    background: transparent; 
    
    /* Remove blur on the button so it doesn't distort the card below */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    
    /* Subtle border to define the click area */
    border: 1px solid rgba(255, 255, 255, 0.3);
    
    border-radius: 16px; 
    font-size: 1.1rem; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    color: var(--text-main);
    font-weight: 500;
}

/* HOVER: Now the glass effect appears only when you touch it */
.option-item:hover { 
    background: rgba(255, 255, 255, 0.2); /* Faint white highlight */
    border-color: var(--accent-blue); 
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(143, 184, 237, 0.2);
    backdrop-filter: blur(4px); /* Blur activates on hover */
}

/* Correct/Wrong States (These override the glass look when clicked) */
.correct { 
    background-color: #d1fae5 !important; 
    border-color: var(--success) !important; 
    color: #064e3b; 
    font-weight: 600; 
}
.wrong { 
    background-color: #fee2e2 !important; 
    border-color: var(--error) !important; 
    color: #991b1b; 
}
.disabled { pointer-events: none; }

/* Explanation Box (Glassy look too) */
.explanation-box { 
    max-height: 0; overflow: hidden; opacity: 0; transition: 0.4s ease; 
}
.explanation-box.show { 
    max-height: 600px; opacity: 1; margin-top: 25px; padding: 25px; 
    
    /* Glassy Explanation Background */
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    
    border-left: 5px solid var(--accent-blue); 
    border-radius: 0 15px 15px 0; font-size: 1.1rem;
}

/* =========================================
   6. WELCOME MODAL STYLES (GLOBAL)
   ========================================= */
.modal-overlay {
        display: flex !important;
        align-items: center !important;     /* Centers Vertically */
        justify-content: center !important; /* Centers Horizontally */
        padding: 0 !important;              /* Remove padding so it doesn't push the box */
        
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(44, 62, 80, 0.7); backdrop-filter: blur(8px);
        z-index: 20000; opacity: 0; visibility: hidden; transition: all 0.3s ease;
    }
    
    .modal-overlay.active { opacity: 1; visibility: visible; }

    /* 2. CHILD: Define Width & Remove Margins */
    .modal-content {
    background: white;
    width: 100%;
    
    /* BIGGER DESKTOP SIZE */
    max-width: 650px; /* Increased from 450px */
    padding: 45px;    /* Increased padding for a spacious feel */
    
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
    
    /* Centering logic (Desktop uses margin auto if flex parent allows) */
    margin: auto; 
}
    
    .modal-overlay.active .modal-content { transform: scale(1); }

.modal-header h2 {
    margin: 0 0 20px 0;
    color: var(--header-bg);
    font-size: 2.2rem; /* Increased from 1.6rem */
    text-align: center;
    font-weight: 800;
}

/* 2. BIGGER INTRO TEXT */
.modal-body p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 1.15rem; /* Increased from 0.95rem */
    line-height: 1.6;
}

.guide-step {
    display: flex;
    align-items: center;
    gap: 20px; /* More gap between icon and text */
    margin-bottom: 20px;
    background: #f8fafc;
    
    /* MORE PADDING inside the steps */
    padding: 18px 25px; 
    
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}
.step-icon {
    font-size: 1.8rem; /* Larger icons */
    width: 50px;       /* Larger circle */
    height: 50px;
    background: white;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    flex-shrink: 0;
}
.step-text { display: flex; flex-direction: column; }
.step-text strong {
    color: var(--text-main);
    font-size: 1.2rem; /* Increased from 0.95rem */
    margin-bottom: 4px;
    display: block;
}

.step-text span {
    font-size: 1rem; /* Increased from 0.8rem */
    color: var(--text-muted);
    line-height: 1.4;
}

/* 4. BIGGER BUTTON */
.start-btn {
    width: 100%;
    padding: 18px; /* Taller button */
    margin-top: 15px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #5c9ce6 100%);
    color: white;
    font-size: 1.3rem; /* Increased from 1.1rem */
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(143, 184, 237, 0.4);
}
.start-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(143, 184, 237, 0.6); }

/* =========================================
   7. MOBILE VIEW OVERRIDES (UNDER 1024px)
   ========================================= */
@media (max-width: 1024px) {
    
    html { font-size: 12px; }

    /* HIDE DESKTOP ELEMENTS */
    .desktop-header, .nav-wrapper.desktop-only, aside.desktop-only, .desktop-guide { 
        display: none !important; 
    }

    /* SHOW MOBILE ELEMENTS */
    .mobile-header {
        display: flex !important; position: fixed; top: 0; left: 0; 
        width: 100%; height: 65px; background: var(--header-bg); z-index: 10000;
        align-items: center; justify-content: space-between;
        padding: 0 12px; box-sizing: border-box; color: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    .mobile-guide { display: block !important; }

    .header-brand {
        font-weight: 800; font-size: 1rem; color: white;
        flex-grow: 1; text-align: center; margin: 0 10px;
    }
    .header-right-group { display: flex; gap: 8px; }

    .container {
        display: block !important; margin: 85px auto 20px auto; 
        padding: 0 15px; max-width: 100%;
    }

    /* DRAWER STYLES */
    .drawer {
        display: block !important; position: fixed; top: 50px; 
        width: 70%; height: calc(100vh - 50px);
        background: linear-gradient(135deg, var(--body-start) 0%, var(--body-end) 100%);
        z-index: 9000; padding: 35px 20px 20px 20px; 
        transition: transform 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1); overflow-y: auto;
    }
    .from-left { left: 0; transform: translateX(-100%); }
    .from-right { right: 0; transform: translateX(100%); }
    .drawer.active { transform: translateX(0); }

    .drawer-header {
        display: flex; justify-content: space-between; align-items: center;
        margin-bottom: 20px; padding-bottom: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.4); width: 100%;
    }
    .drawer h3 { color: var(--header-bg); font-size: 1.1rem; font-weight: 800; margin: 0; }
    .close-drawer {
        background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.6);
        color: var(--text-main); width: 35px; height: 35px; border-radius: 50%;
        font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
        cursor: pointer;
    }

    /* MOBILE COMPONENTS */
    .subject-trigger {
        background: linear-gradient(135deg, var(--body-start) 0%, var(--body-end) 100%);
        color: var(--header-bg) !important; border: 1px solid rgba(255, 255, 255, 0.4); 
        padding: 8px 14px; border-radius: 8px; font-weight: 800; font-size: 0.7rem;
        letter-spacing: 0.8px; text-transform: uppercase; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); 
        cursor: pointer; display: flex; align-items: center; justify-content: center;
    }

    .q-number-box {
        background: linear-gradient(135deg, var(--body-start) 0%, var(--body-end) 100%);
        color: var(--header-bg); width: 36px; height: 36px;
        display: flex; align-items: center; justify-content: center;
        border-radius: 8px; font-weight: 800; font-size: 0.9rem;
        cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .status-box {
        background: linear-gradient(135deg, var(--body-start) 0%, var(--body-end) 100%);
        border: 1px solid rgba(255, 255, 255, 0.3); padding: 0 10px;
        border-radius: 8px; display: flex; align-items: center; gap: 6px;
        height: 36px; min-width: auto; cursor: pointer;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    .status-label { color: var(--header-bg); font-size: 0.55rem; font-weight: 700; opacity: 0.9; }
    #overall-progress { font-size: 0.85rem; font-weight: 800; color: #1e3a8a; }

    /* MOBILE DRAWER LISTS */
    .mobile-subject-list { display: flex; flex-direction: column; gap: 12px; }
    .sub-btn {
        width: 100%; text-align: left; background: var(--card-bg);
        color: var(--text-main); padding: 18px 20px; border-radius: 16px; 
        border: 1px solid rgba(255, 255, 255, 0.5); font-size: 1rem; font-weight: 700;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); 
        display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; 
    }
    .sub-btn::after { content: "→"; color: var(--accent-blue); font-weight: 800; font-size: 1.2rem; }
    
    .sub-btn.active {
        background-color: var(--accent-blue) !important; color: white !important;
        border-color: var(--accent-blue); box-shadow: 0 4px 12px rgba(143, 184, 237, 0.6);
    }
    .sub-btn.active::after { color: white; }

    #mobile-nav-target #question-navigation {
        display: grid !important; grid-template-columns: repeat(4, 1fr);
        gap: 10px; padding: 10px; background: transparent; box-shadow: none; border: none;
    }
    #mobile-nav-target .nav-number {
        width: 100%; height: 40px; background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05); font-size: 1rem;
    }
    #mobile-nav-target .nav-number.answered {
        background-color: var(--accent-blue) !important; color: white !important;
        border-color: var(--accent-blue); box-shadow: 0 2px 8px rgba(143, 184, 237, 0.6);
    }

    /* SCROLL FIXES */
    #mobile-stats-target, #mobile-nav-target, .mobile-subject-list {
        padding-bottom: 50px !important; display: block;
    }

   #mobile-stats-target .stats-card {
        background: white; 
        margin-bottom: 15px; 
        padding: 20px;
        border-radius: 16px; 
        border-left: none; /* <--- This removes the blue border */
        border: 1px solid #e2e8f0; /* Adds a clean gray border all around instead */
    }
    #mobile-stats-target .progress-container {
        height: 12px; background-color: #e2e8f0; width: 100%; margin-top: 10px;
    }
    #mobile-stats-target .progress-fill {
        background: linear-gradient(90deg, var(--accent-blue), #5c9ce6);
    }
    #mobile-stats-target .desktop-only { display: flex !important; width: 100%; padding: 5px; }

    /* === MOBILE MODAL OVERRIDE (THE FIX) === */
    .modal-content {
        width: 85%; /* Ensures side gaps */
        max-width: 400px;
        padding: 25px 20px;
        margin: 0 auto; /* Forces Centering */
        box-sizing: border-box; /* Keeps padding inside */
    }

    .modal-header h2 { font-size: 1.4rem; margin-bottom: 10px; }
    .guide-step { padding: 10px; gap: 10px; margin-bottom: 10px; }
    .step-icon { width: 36px; height: 36px; font-size: 1.2rem; }
}

/* =========================================
   BLACK THEME ANIMATION
   ========================================= */
#loader-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    
    /* 1. Pitch Black Background */
    background-color: #000000;
    
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: opacity 0.8s ease-out, visibility 0.8s;
}

#loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* 2. COLORFUL TYPING TEXT */
.typing-text {
    font-family: 'Courier New', monospace; /* Monospace fits typing best */
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 2px;
    white-space: nowrap; /* Keep on one line */
    overflow: hidden; /* Hide text before it's typed */
    border-right: 4px solid white; /* The Cursor */
    
    /* Rainbow Gradient Text */
    background: linear-gradient(90deg, #ff0000, #ffa500, #ffff00, #008000, #0000ff, #4b0082, #ee82ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    
    /* The Typing Animation (3.5s duration) */
    animation: 
        typing 3s steps(30, end),
        blink-caret 0.75s step-end infinite;
}

/* 3. POP IN SUBTITLE (Out to In) */
.pop-in-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0; /* Start hidden */
    
    /* Wait 3s (until typing finishes) then POP */
    animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: 2.5s; 
}

/* 4. DESIGNER NAMES */
.designer-text {
    margin-top: 80px; /* More space from the top */
    font-size: 1.8rem; /* Much bigger "Designed by" text */
    color: #bbb;       /* Light gray for better visibility */
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    
    /* Fade in animation */
    animation: fadeInSimple 1s ease forwards 0.5s;
}

#dynamic-name {
    display: block; /* Moves name to its own line for maximum size */
    margin-top: 10px;
    
    color: #00e5ff; /* Cyan Neon */
    font-weight: 900;
    font-size: 4rem; /* MASSIVE SIZE for the Names */
    letter-spacing: 4px;
    
    /* Strong Neon Glow */
    text-shadow: 
        0 0 10px rgba(0, 229, 255, 0.8),
        0 0 20px rgba(0, 229, 255, 0.5);
        
    transition: all 0.3s ease;
}

/* Animations */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: white; }
}

@keyframes popIn {
    0% { transform: scale(3); opacity: 0; } /* Start HUGE and invisible */
    100% { transform: scale(1); opacity: 1; } /* End Normal */
}

@keyframes fadeInSimple {
    to { opacity: 1; }
}

/* Mobile Adjustments for the Big Text */
@media (max-width: 768px) {
    .typing-text { font-size: 1.5rem; }
    .pop-in-text { font-size: 0.9rem; }
    
    /* Resize footer for mobile so it fits */
    .designer-text { font-size: 1.2rem; margin-top: 60px; }
    #dynamic-name { font-size: 2.8rem; } 
}

/* =========================================
   EXPLANATION IMAGE & TOGGLE BUTTON
   ========================================= */

/* The "Show Image" Button */
.toggle-img-btn {
    margin-top: 15px;
    padding: 10px 18px;
    border: 1px solid var(--accent-blue);
    background: white;
    color: var(--accent-blue);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-img-btn:hover {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(143, 184, 237, 0.4);
}

/* The Image Container (Hidden by Default) */
.exp-image-container {
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    opacity: 0;
    transition: all 0.4s ease-in-out;
}

/* When Active (Button Clicked) */
.exp-image-container.active {
    max-height: 500px; /* Big enough to fit most images */
    opacity: 1;
    margin-top: 15px;
}

/* The Image Itself */
.exp-image-container img {
    width: 100%;
    max-width: 400px; /* Limits width on big screens */
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: block;
}


/* =========================================
   FULL SCREEN IMAGE MODAL
   ========================================= */
#fullscreen-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 100000; /* Highest layer! Above everything */
    padding-top: 50px;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95); /* Deep black background */
    backdrop-filter: blur(5px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

#fullscreen-modal.active {
    display: flex; /* Flex centers the image */
}

/* The Big Image */
#fs-image-target {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh; /* Keeps it within screen height */
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    animation: zoomIn 0.3s;
}

/* Close Button (X) */
.close-fs {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.close-fs:hover { color: var(--error); }

.fs-caption {
    position: absolute;
    bottom: 85px; /* Increased from 45px to 85px */
    left: 50%;
    transform: translateX(-50%);
    
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    text-align: center;
    
    animation: fadeIn 0.5s;
}

/* MOBILE FIX: Hide the text completely on screens smaller than 768px */
@media (max-width: 768px) {
    .fs-caption {
        display: none !important;
    }
}

/* Overlay Button on the Inline Image */
.fs-btn-overlay {
    margin-top: 8px;
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: 0.2s;
}
.fs-btn-overlay:hover { background: black; }

/* Keyframes */
@keyframes zoomIn { from {transform:scale(0.8); opacity:0} to {transform:scale(1); opacity:1} }

/* =========================================
   IMAGE PROTECTION (Anti-Download)
   ========================================= */
img {
    /* 1. Stop users from highlighting the image like text */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    
    /* 2. Stop users from dragging the image to their desktop */
    -webkit-user-drag: none;
    user-drag: none;
    
    /* Optional: Disable touch callouts (iOS) */
    -webkit-touch-callout: none; 
}


/* =========================================
   ZOOM CONTROLS & PANNING
   ========================================= */

/* 1. Image Container (The Window) */
#fs-img-container {
    width: 100%;
    height: 80vh; /* Takes up most of the screen */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Hides the parts of image that go off screen */
    cursor: grab; /* Shows hand icon */
}

#fs-img-container:active {
    cursor: grabbing; /* Shows grabbing hand when moving */
}

/* 2. The Image */
#fs-image-target {
    max-width: 90%;
    max-height: 90%;
    transition: transform 0.1s ease-out; /* Smooth movement */
    transform-origin: center center;
    /* Disable native touch actions so our script handles it */
    touch-action: none; 
}

/* 3. Floating Toolbar */
.zoom-controls {
    position: absolute;
    bottom: 120px; /* Increased from 80px to 120px */
    left: 50%;
    transform: translateX(-50%);
    
    background: rgba(44, 62, 80, 0.9);
    padding: 8px 15px;
    border-radius: 50px;
    display: flex;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 100001;
}

.zoom-controls button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center;
}

.zoom-controls button:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}



