/* GLOBAL RESPONSIVE RESET */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
    display: block; /* Removes tiny space below inline images */
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #fdfbf7; /* Light Parchment */
    color: #333;
}
.header-text { color: #6A0505; /* Deep Maroon */ }
.accent-gold { color: #FFC300; }
.accent-maroon { color: #6A0505; }
.status-correct { color: #0E7C0E; }
.status-incorrect { color: #D32F2F; }
.status-flagged { color: #0077B6; } /* Medium Blue for Flag */
.timer-alert { color: #D32F2F; }

.option {
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.3s ease, border-color 0.3s ease;
}
.option:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.option:disabled {
    cursor: not-allowed;
}

.option.selected {
    border-color: #6A0505;
    background-color: #fce9e9;
    box-shadow: 0 0 0 2px #6A0505;
}

.option.practice-correct {
    border-color: #0E7C0E;
    background-color: #e7f4e7;
    box-shadow: 0 0 0 2px #0E7C0E;
}
.option.practice-incorrect {
    border-color: #D32F2F;
    background-color: #fdeaea; 
}

.option.review-correct {
    border-color: #0E7C0E;
    background-color: #e7f4e7; 
}
.option.review-incorrect {
    border-color: #D32F2F;
    background-color: #fdeaea; 
}
/* Home screen review options */
.option-review-static {
    border: 2px solid #e5e7eb; /* gray-200 */
}
.option-review-static.correct {
    border-color: #0E7C0E;
    background-color: #e7f4e7; 
    font-weight: 600;
}

.modal {
    transition: opacity 0.3s ease-in-out;
}
input[type="number"]:focus, input[type="checkbox"]:focus, input[type="search"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 5, 5, 0.3);
    border-color: #6A0505;
}
/* Custom Checkbox */
.custom-checkbox:checked {
    background-color: #6A0505;
    border-color: #6A0505;
}
/* Add this rule to the bottom of style.css */
.hidden {
    display: none !important; /* Forces the element to disappear */
}

/* --- SECURITY PROTOCOL STYLES --- */

/* 1. Disable Selection (The Shield) */
body.secure-mode {
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+/Edge */
    user-select: none;         /* Standard */
    -webkit-touch-callout: none; /* iOS Safari */
}

/* 2. Watermark Grid (The Deterrent) */
#watermark-overlay {
    pointer-events: none; /* Allows clicks to pass through to the buttons below */
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: 9998; /* High Z-Index to sit on top */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    opacity: 0.06; /* Very faint (8% is sometimes too visible, 6% is better) */
    transform: rotate(-30deg); /* Diagonal rotation */
    overflow: hidden;
}

.watermark-text {
    color: #000;
    font-size: 14px;
    font-weight: 900;
    padding: 60px; /* Spacing between the emails */
    white-space: nowrap;
    text-transform: uppercase;
    font-family: sans-serif;
}

/* 3. Security Toast Notification */
#security-toast {
    z-index: 10000; /* Highest priority */
}

        .topography-bg {
            background-color: #4a0404;
            background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%237d1a1a' fill-opacity='0.2' fill-rule='evenodd'/%3E%3C/svg%3E");
        }
        .phone-container { perspective: 1000px; }
        .phone-mockup { transform: rotateY(-15deg) rotateX(10deg); transition: transform 0.5s ease; box-shadow: 20px 20px 60px rgba(0,0,0,0.5); }
        .phone-mockup:hover { transform: rotateY(-5deg) rotateX(5deg) scale(1.02); }
        .hide-scroll::-webkit-scrollbar { display: none; }
        .hide-scroll { -ms-overflow-style: none; scrollbar-width: none; }

html {
            scroll-behavior: smooth;
        }

        /* Custom Logo Font Adjustments */
        .logo-text-upper {
            font-family: 'Poppins', sans-serif;
            font-weight: 800;
            letter-spacing: -0.5px;
        }
        
        /* Calculator Styles */
.calc-btn {
    padding: 10px;
    background: #374151;
    color: white;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.1s;
}
.calc-btn:active { background: #4b5563; }
.calc-btn.op { background: #fbbf24; color: black; }
.calc-btn.eq { background: #6A0505; color: white; }

/* Rich Content Support */
#question-text img, .option img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
    display: block;
}

/* --- CSS SAFETY LAYER (The Emergency Kit) --- */
/* Use these in JS when elements refuse to show up */

/* Forces an element to appear, overriding 'hidden' or 'display: none' */
.force-show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 9999 !important; /* Ensures it sits on top */
}

/* Forces an element to hide */
.force-hide {
    display: none !important;
}

/* Forces text/icon color to be visible (fixes white-on-white issues) */
.force-visible-icon {
    color: #6A0505 !important; /* Your Maroon Color */
    background-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
}

/* --- FLASHCARD 3D FLIP STYLES --- */

.perspective-container {
    perspective: 1000px; /* Gives the 3D depth */
}

.card-face {
    backface-visibility: hidden; /* Hides the back when facing away */
    -webkit-backface-visibility: hidden;
    border-radius: 0.75rem; /* Matches rounded-xl */
}

/* Front Face Default */
.card-front {
    transform: rotateY(0deg);
}

/* Back Face Default */
.card-back {
    transform: rotateY(180deg);
}

/* FLIPPED STATE */
.is-flipped .card-front {
    transform: rotateY(-180deg);
}

.is-flipped .card-back {
    transform: rotateY(0deg);
}

/* Scrollbar hiding for cards */
.hide-scroll::-webkit-scrollbar { display: none; }
.hide-scroll { -ms-overflow-style: none; scrollbar-width: none; }

/* --- MULTIPLAYER & SOCIAL STYLES --- */

/* Lobby Player List */
.player-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.player-card.ready {
    border-color: #0E7C0E;
    background-color: #e7f4e7;
}
.player-card.host {
    border-color: #ffc107;
}

/* Realtime "Opponent Won" Effect */
.opponent-win-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* News Feed Cards */
.news-card {
    transition: transform 0.2s;
}
.news-card:hover {
    transform: translateY(-2px);
}
.news-tag {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
}
.tag-update { background: #e0f2fe; color: #0369a1; }
.tag-competition { background: #fef9c3; color: #854d0e; }
.tag-alert { background: #fee2e2; color: #991b1b; }

/* Driver.js Popover Customization */
div.driver-popover.driverjs-theme {
    background-color: #fff;
    color: #333;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
div.driver-popover.driverjs-theme .driver-popover-title {
    color: #6A0505; /* Maroon */
    font-size: 18px;
    font-weight: bold;
}
div.driver-popover.driverjs-theme button.driver-next-btn {
    background-color: #6A0505;
    color: #fff;
    text-shadow: none;
    border: none;
    border-radius: 6px;
}

/* --- SAFE AREA UTILITIES (For iPhone X+ Home Bar) --- */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom);
}
.pt-safe {
    padding-top: env(safe-area-inset-top);
}
.min-h-screen-safe {
    min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

/* --- APP MODE VS WEBSITE MODE --- */

/* 1. Default: We are on the website */
.app-only-feature { 
    display: none !important; 
}

/* 2. Detection: We are in the Installed App */
@media all and (display-mode: standalone) {
    
    /* Hide anything marked as "website only" (Navbars, Footers, Ads) */
    .website-only-feature {
        display: none !important;
    }

    /* Show things meant only for the app (Splash headers, special buttons) */
    .app-only-feature {
        display: block !important;
    }

    /* Adjust the main wrapper to look like a native app */
    #landing-page {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        background: #fff;
    }
    
    /* Force the CBT View to be full screen */
    #view-cbt {
        height: 100vh;
        width: 100vw;
        overflow-y: auto;
    }
}

#main-menu-panel {
    position: fixed; 
    top: 65px; 
    left: 0;
    width: 100%;
    z-index: 40;
    background-color: #4a1856; /* sb-purple */
    color: white;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* --- NEW ANIMATION LOGIC --- */
    /* 1. Reset the position so it sits directly below the header */
    transform: translateY(0) !important; 
    
    /* 2. Hide it by clipping 100% of the height from the bottom up */
    clip-path: inset(0 0 100% 0);
    
    /* 3. smooth transition for the curtain effect */
    transition: clip-path 0.4s ease-in-out;
}

/* Class to open the menu */
#main-menu-panel.menu-open {
    /* Reveal the full menu */
    clip-path: inset(0 0 0 0); 
}

/* Ensure study tools have space below the header and push the footer down */
#quiz-master-screen, 
#setup-screen, 
#library-screen, 
#history-screen,
#news-screen,
#bookmarks-screen,
#flashcard-screen,
#admin-dashboard {
    padding-top: 100px; /* Space for the sticky header */
    min-height: 70vh;   /* Minimum height to keep footer at bottom */
    width: 100%;
}

/* --- BLOG CONTENT LINK STYLING --- */
#news-detail-body a {
    color: #2563eb !important; /* Professional blue */
    text-decoration: underline !important;
    font-weight: 600;
    transition: color 0.2s;
}

#news-detail-body a:hover {
    color: #1d4ed8 !important; /* Darker blue on hover */
}

/* --- PROFESSIONAL FLOATING WHATSAPP --- */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 25%; /* Roughly 3/4 down the screen */
    right: 20px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0px 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(10deg);
    background-color: #1ebe5d;
}

/* --- BRAND CARD BLEND --- */
.scholars-card {
    background: #ffffff;
    border: 1px solid rgba(74, 24, 86, 0.05);
    box-shadow: 0 10px 40px -10px rgba(74, 24, 86, 0.08);
    border-radius: 2rem;
    transition: all 0.3s ease;
}

.scholars-card:hover {
    border-color: #4ac2e3; /* sb-cyan */
    transform: translateY(-5px);
}

/* --- SCHOLARS BIBLE NOTE STYLING (Replaces Tailwind Prose) --- */
#study-content-body h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #4a0404; /* sb-maroon */
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #ffc107; /* sb-gold */
    padding-bottom: 0.5rem;
}

#study-content-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4a0404;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

#study-content-body h3, #study-content-body h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333333;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

#study-content-body p {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

#study-content-body ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

#study-content-body ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

#study-content-body li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

#study-content-body strong, #study-content-body b {
    font-weight: 700;
    color: #4a0404;
}

#study-content-body hr {
    margin-top: 2rem;
    margin-bottom: 2rem;
    border: 0;
    border-top: 1px solid #e5e7eb;
}

/* --- AUTOFILL DETECTION ANIMATION --- */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    /* Trigger the JS animation listener */
    animation-name: onAutoFillStart;
    animation-duration: 0.01s;
    animation-fill-mode: both;
    
    /* Optional: Maintain your Tailwind input styling instead of browser defaults */
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #333 !important;
}

@keyframes onAutoFillStart {
    from { opacity: 0.99; }
    to { opacity: 1; }
}