/* quiz-style.css - Version 6.0 (Full Screen Fix) */

.bio-quiz-container {
    max-width: 800px;
    margin: 30px auto;
    background-color: #1e293b; 
    color: #f1f5f9;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    font-family: 'Segoe UI', sans-serif;
    position: relative;
    border: 1px solid #334155;
    box-sizing: border-box;
    
    /* FLEX LAYOUT */
    display: flex;
    flex-direction: column;
    min-height: 400px; 
}

.bio-quiz-container * {
    box-sizing: border-box;
}

/* --- FULLSCREEN FIX (CRITICAL UPDATES) --- */
.bio-quiz-container.fullscreen {
    position: fixed !important; 
    top: 0 !important; 
    left: 0 !important;
    right: 0 !important;     /* Added: Anchors to right */
    bottom: 0 !important;    /* Added: Anchors to bottom */
    
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important; /* Mobile Dynamic Height */
    
    /* CRITICAL: Override the 800px limit from the main class */
    max-width: none !important; 
    max-height: none !important;
    
    /* CRITICAL: Highest possible Z-Index to cover WP Admin Bar/Header */
    z-index: 2147483647 !important; 
    
    border-radius: 0 !important;
    margin: 0 !important;
    border: none !important;
    background-color: #1e293b !important; /* Ensure solid background */

    /* Prevent body scroll behind the quiz */
    overscroll-behavior: contain;
    
    /* Handle iPhone Notch / Status Bar */
    padding-top: env(safe-area-inset-top); 
    padding-bottom: env(safe-area-inset-bottom);
}

/* --- SCROLLABLE CONTENT AREA --- */
#quiz-game-screen, 
#quiz-start-screen, 
#quiz-result-screen {
    flex: 1;            
    overflow-y: auto;   
    padding: 30px;
    text-align: center;
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: thin; 
    scrollbar-color: #3b82f6 #1e293b;
}

/* Scrollbar styling */
#quiz-game-screen::-webkit-scrollbar { width: 8px; }
#quiz-game-screen::-webkit-scrollbar-track { background: #1e293b; }
#quiz-game-screen::-webkit-scrollbar-thumb { background-color: #3b82f6; border-radius: 4px; }

/* --- HEADER --- */
.quiz-header {
    flex: 0 0 auto; 
    background-color: #0f172a;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    z-index: 10;
}

#topic-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #e2e8f0;
}

.header-tools { display: flex; align-items: center; gap: 15px; }

.tool-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tool-btn:hover { color: #ffffff; background: rgba(255,255,255,0.1); border-radius: 50%; }

/* --- MODAL FIX --- */
#bio-modal-overlay {
    position: fixed; /* Must be fixed to stay on screen */
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    
    /* Z-Index higher than Fullscreen Container */
    z-index: 2147483648; 
    
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.bio-modal-box {
    background: #1e293b;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: fadeIn 0.2s ease-out;
}

.bio-modal-header {
    background: #0f172a;
    padding: 12px 15px;
    font-weight: bold;
    color: #3b82f6;
    border-bottom: 1px solid #334155;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bio-modal-body {
    padding: 25px;
    color: #ffffff;
    font-size: 1.1rem;
    text-align: center;
    line-height: 1.5;
}

.bio-modal-footer {
    padding: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
    border-top: 1px solid #334155;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* General Styles */
#quiz-start-screen h2, #quiz-start-screen p { color: #ffffff !important; margin-bottom: 10px; }

.quiz-select {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px;
    padding: 12px;
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #475569;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
}

.quiz-btn {
    padding: 12px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    margin: 5px;
    font-weight: 600;
}
.quiz-btn.primary { background-color: #3b82f6; color: white !important; }
.quiz-btn.primary:hover { background-color: #2563eb; }
.quiz-btn.secondary { background-color: #475569; color: white !important; }

#question-text {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #ffffff;
    text-align: left;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}
@media (max-width: 600px) { .options-grid { grid-template-columns: 1fr; } }

.option-btn {
    background-color: #334155 !important;
    color: #ffffff !important;
    border: 2px solid #475569;
    padding: 15px;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.4;
}
.option-btn:hover { background-color: #475569 !important; border-color: #64748b; }
.option-btn.correct { background-color: #065f46 !important; border-color: #34d399 !important; color: #ffffff !important; }
.option-btn.wrong { background-color: #7f1d1d !important; border-color: #f87171 !important; color: #ffffff !important; }
.option-btn.disabled { pointer-events: none; opacity: 0.7; }

#solution-box {
    margin-top: 20px;
    padding: 20px;
    background-color: #1e293b; 
    border: 1px solid #3b82f6; 
    border-left: 5px solid #3b82f6;
    color: #e2e8f0;
    text-align: left;
    border-radius: 6px;
    word-wrap: break-word; 
}

#score-board { font-weight: bold; color: #fbbf24; }
.progress-bar { height: 4px; background-color: #334155; width: 100%; flex: 0 0 auto; }
#progress-fill { height: 100%; background-color: #3b82f6; width: 0%; transition: width 0.3s ease; }
.final-score-box h1 { font-size: 4rem; color: #3b82f6; margin: 10px 0; }

/* HIDE WORDPRESS ADMIN BAR IN FULLSCREEN */
body.quiz-fullscreen-active #wpadminbar {
    display: none !important;
}