/* =========================================================================
   CDS COMMAND CENTER: SSB MODULE PREMIUM STYLES
   ========================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Utility classes must be at top or have highest specificity */
.hidden {
    display: none !important;
}

/* Variables for the Premium Military Glassmorphism Theme */
:root {
    --accent: #7ed321;
    --accent-dark: #5fa515;
    --accent-glow: rgba(126, 211, 33, 0.4);
    
    --bg-dark: #0b1416;
    --bg-medium: #0e1b1f;
    --bg-light: #12252a;
    
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-bg-hover: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f8f9fa;
    --text-secondary: #b7c6cc;
    
    --danger: #ff4757;
    --danger-glow: rgba(255, 71, 87, 0.5);
    
    --warning: #ffa502;
}

body {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    /* Immersive military dark mode gradient */
    background:
        radial-gradient(circle at 20% 30%, rgba(120, 200, 40, 0.08), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(120, 200, 40, 0.06), transparent 40%),
        linear-gradient(135deg, var(--bg-dark), var(--bg-medium), var(--bg-light));
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* =========================================================================
   ANIMATIONS
   ========================================================================= */

@keyframes fadeSlideUp {
    0% { opacity: 0; transform: translateY(20px); filter: blur(4px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px var(--accent-glow); }
    100% { box-shadow: 0 0 25px var(--accent-glow), 0 0 40px rgba(126, 211, 33, 0.2); }
}

@keyframes urgentPulse {
    0% { text-shadow: 0 0 5px var(--danger-glow); box-shadow: inset 0 0 10px rgba(255,71,87,0.1); }
    100% { text-shadow: 0 0 20px var(--danger), 0 0 30px var(--danger-glow); box-shadow: inset 0 0 20px rgba(255,71,87,0.3); border-color: rgba(255,71,87,0.5); }
}

.test-section, .instructions, .test-complete, .test-selection, .picture-selection, .gto-overview, .olq-overview {
    animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* =========================================================================
   TYPOGRAPHY & HEADERS
   ========================================================================= */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.test-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 50px 60px;
    background: var(--card-bg);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.test-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.header-with-back {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-title h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.header-title p {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* =========================================================================
   BUTTONS
   ========================================================================= */

button, .btn-primary, .btn-nav, .btn-home, .btn-back-home, .btn-close, .btn-pause, .btn-material-viewer, .btn-back {
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

/* Modern Green Primary Action */
.btn-primary, .btn-nav, .btn-close {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: #000; /* Dark text on bright accent for high contrast & premium feel */
    padding: 14px 28px;
    box-shadow: 0 4px 15px rgba(126, 211, 33, 0.3);
}

.btn-primary:hover, .btn-nav:hover:not(:disabled), .btn-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(126, 211, 33, 0.5);
    background: linear-gradient(135deg, var(--accent), #94e838);
}

/* Secondary / Back Buttons */
.btn-back, .btn-home, .btn-back-home {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding: 12px 24px;
    border: 1px solid var(--border-light);
    backdrop-filter: blur(5px);
}

.btn-back:hover, .btn-home:hover, .btn-back-home:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-home {
    position: absolute;
    left: 0;
}

/* Pause Button */
.btn-pause {
    padding: 12px 24px;
    background: rgba(255, 165, 2, 0.15);
    color: var(--warning);
    border: 1px solid rgba(255, 165, 2, 0.3);
}

.btn-pause:hover {
    background: rgba(255, 165, 2, 0.25);
    box-shadow: 0 4px 15px rgba(255, 165, 2, 0.2);
}

/* Material Viewer Trigger */
.btn-material-viewer {
    width: 100%;
    padding: 16px;
    margin-top: 30px;
    background: rgba(126, 211, 33, 0.1);
    color: var(--accent);
    border: 1px solid rgba(126, 211, 33, 0.3);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.btn-material-viewer:hover {
    background: rgba(126, 211, 33, 0.15);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(126, 211, 33, 0.2);
    transform: translateY(-2px);
}

.btn-nav:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* =========================================================================
   CARDS & PANELS (Dashboard style)
   ========================================================================= */

.test-selection, .picture-selection, .instructions, .gto-overview, .olq-overview {
    background: var(--card-bg);
    padding: 50px;
    border-radius: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    margin-bottom: 40px;
}

.test-selection h2, .picture-selection h2, .instructions h2, .gto-overview h2, .olq-overview h2 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 40px;
    font-size: 2.2rem;
}

/* Grid Layouts */
.test-grid, .picture-grid, .gto-tasks-grid, .olq-factors-grid {
    display: grid;
    gap: 30px;
}

.test-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.picture-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 40px; }
.gto-tasks-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 40px; }
.olq-factors-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: 40px; }

/* Interactive Cards */
.test-card, .gto-task-card, .olq-factor-card, .picture-option {
    background: rgba(255, 255, 255, 0.02);
    padding: 35px 25px;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.picture-option { padding: 15px; }

.test-card:hover, .gto-task-card:hover, .olq-factor-card:hover, .picture-option:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    border-color: rgba(126, 211, 33, 0.4);
}

.test-icon, .task-icon, .factor-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

.test-card h3, .gto-task-card h3, .olq-factor-card h3 {
    color: var(--text-primary);
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.olq-factor-card h4 {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.test-card p, .gto-task-card p, .picture-option p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.test-duration, .task-duration {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(126, 211, 33, 0.1);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(126, 211, 33, 0.2);
}

/* =========================================================================
   CINEMATIC TEST FOCUS MODE (UX IMPROVEMENT)
   ========================================================================= */

/* The test screen becomes a full-width cinematic view */
.test-screen {
    background: transparent;
    border-radius: 0;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 0;
}

/* Premium Top Navigation / Timer Bar */
.timer-display {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: var(--card-bg);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.timer-display h3 {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin: 0;
    flex-basis: 30%;
    text-align: left;
}

/* Glowing Minimalist Timer */
.timer {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'SF Mono', 'Courier New', monospace;
    letter-spacing: 2px;
    text-shadow: 0 0 15px var(--accent-glow);
    padding: 10px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(126, 211, 33, 0.3);
    flex-basis: auto;
    text-align: center;
    /* Optional: Animate urgency when time is low via JS, 
       but since we can't alter JS, we supply the permanent pulse for SRT/PPDT feeling. */
    animation: urgentPulse 3s infinite alternate;
}

.test-controls {
    display: flex;
    flex-direction: row;
    gap: 15px;
    margin: 0;
    flex-basis: 30%;
    justify-content: flex-end;
}

.test-controls button {
    width: auto;
    padding: 10px 20px;
}

/* Centered Picture / Distraction Free Display */
.picture-display-large {
    width: 100%;
    max-width: 900px;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.picture-display-large img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
    /* Slight blur initially, then sharp focusing effect? 
       No, we want clear vision. Let's just shadow it. */
    filter: drop-shadow(0 0 20px rgba(0,0,0,0.8));
    animation: fadeSlideUp 0.8s ease forwards;
}

/* Focused Writing Instructions */
.writing-instructions {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--card-bg);
    padding: 50px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    animation: fadeSlideUp 0.5s ease forwards;
}

.writing-instructions h2 {
    color: var(--accent);
    margin-bottom: 30px;
    font-size: 2.2rem;
}

.writing-guide {
    text-align: left;
    max-width: 600px;
}

.writing-guide h3 {
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 1.4rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    display: inline-block;
}

.writing-guide ol {
    margin-left: 20px;
}

.writing-guide li {
    margin: 15px 0;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* =========================================================================
   WAT & SRT SPECIFIC (Minimalist typography focus)
   ========================================================================= */

.word-display {
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.current-word {
    font-size: 6rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 60px 100px;
    background: radial-gradient(circle at center, rgba(126, 211, 33, 0.1), transparent 70%);
    border-radius: 30px;
    border: 1px solid rgba(126, 211, 33, 0.2);
    box-shadow: 0 0 50px rgba(0,0,0,0.5), inset 0 0 20px rgba(126,211,33,0.1);
    text-shadow: 0 4px 20px rgba(126, 211, 33, 0.4);
}

.wat-instruction { margin-top: 40px; }
.wat-instruction p {
    font-size: 1.4rem; color: var(--text-secondary); font-weight: 300; letter-spacing: 1px;
}

.situation-display {
    width: 100%;
    max-width: 900px;
    padding: 60px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--border-light);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.situation-number {
    font-size: 1.4rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
    opacity: 0.8;
}

.situation-text {
    font-size: 1.8rem;
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 500;
}

.srt-navigation {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
}

/* =========================================================================
   INSTRUCTION PANELS & INFO BLOCKS
   ========================================================================= */

.instruction-box, .gto-intro, .olq-intro {
    background: rgba(0, 0, 0, 0.2);
    padding: 35px;
    border-radius: 16px;
    border-left: 4px solid var(--accent);
    margin-bottom: 35px;
}

.instruction-box h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instruction-box ol, .instruction-box ul {
    margin-left: 25px;
    color: var(--text-secondary);
}

.instruction-box li {
    margin: 12px 0;
    font-size: 1.1rem;
}

.warning {
    background: rgba(255, 165, 2, 0.1);
    padding: 18px 25px;
    border-radius: 10px;
    border-left: 4px solid var(--warning);
    margin-top: 25px;
    color: #fff;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =========================================================================
   COMPLETION & DROPDOWNS
   ========================================================================= */

.test-complete {
    background: var(--card-bg);
    padding: 80px 40px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--border-light);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.test-complete h2 {
    color: var(--accent);
    font-size: 3rem;
    margin-bottom: 20px;
}

.dropdown-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    margin-bottom: 30px;
}

.dropdown-selection label {
    font-size: 1.2rem; margin-bottom: 20px; color: var(--text-primary);
}

.picture-dropdown {
    width: 100%; max-width: 400px; padding: 16px 20px; font-size: 1.1rem;
    border: 1px solid rgba(255,255,255,0.2); border-radius: 10px;
    background: var(--bg-dark); color: white; cursor: pointer;
    margin-bottom: 25px; transition: 0.3s;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.picture-dropdown:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(126, 211, 33, 0.3);
}

/* =========================================================================
   MODALS & OVERLAYS & VIEWERS
   ========================================================================= */

.loading-indicator {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(11, 20, 22, 0.95); backdrop-filter: blur(20px);
    padding: 50px 60px; border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    border: 1px solid var(--border-light); text-align: center; z-index: 10000;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.05);
    border-top: 4px solid var(--accent);
    border-radius: 50%; width: 60px; height: 60px;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto 25px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.image-modal {
    position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.95); display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(10px);
}
.modal-content {
    max-width: 90%; max-height: 85vh; border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}
.modal-close {
    position: absolute; top: 40px; right: 60px; color: rgba(255,255,255,0.5);
    font-size: 3rem; cursor: pointer; transition: 0.3s;
}
.modal-close:hover { color: var(--accent); transform: scale(1.1) rotate(90deg); }


/* Factor Cards styling */
.factor-qualities span {
    background: rgba(255,255,255,0.05); color: var(--text-primary);
    padding: 6px 14px; border-radius: 20px; font-size: 0.85rem;
    border: 1px solid rgba(255,255,255,0.1); margin: 2px 0;
}
.factor-qualities { flex-direction: row; flex-wrap: wrap; justify-content: center; }

/* =========================
MATERIAL VIEWER FIX
========================= */

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

/* Card */
.material-item {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 10px;
  border: 1px solid var(--border-light);
  transition: 0.3s;
  cursor: pointer;
  overflow: hidden;
}

/* Hover */
.material-item:hover {
  transform: translateY(-5px);
  border-color: rgba(120,200,40,0.4);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

/* Image container */
.material-item img {
  width: 100%;
  aspect-ratio: 4/3;   /* 🔥 FIXES SIZE ISSUE */
  object-fit: cover;
  border-radius: 8px;
}

/* Label */
.material-item p {
  text-align: center;
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}
/* Grid Items in material viewer */
.material-item, .word-chip, .situation-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px; transition: 0.3s;
}
.material-item:hover, .word-chip:hover, .situation-item:hover {
    background: rgba(255,255,255,0.05); border-color: rgba(126,211,33,0.3);
}
.situation-item { padding: 25px; border-left: 4px solid var(--accent); }

/* Task details specifics */
.task-header, .factor-header { background: rgba(0,0,0,0.3); border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); }
.task-description, .task-process, .factor-description {
    background: rgba(255,255,255,0.02); border-left: 4px solid var(--accent); border-radius: 12px;
}
.quality-card {
    background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05);
}


/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 1024px) {
    .timer-display { flex-direction: column; gap: 15px; text-align: center; }
    .timer-display h3 { flex-basis: auto; text-align: center; }
    .test-controls { flex-basis: auto; justify-content: center; flex-wrap: wrap; }
    .picture-display-large { min-height: 40vh; }
}

@media (max-width: 768px) {
    .btn-home { position: static; transform: none; display: block; margin-bottom: 20px; }
    .header-with-back { flex-direction: column; }
    .test-header { padding: 30px 20px; }
    
    .test-selection, .picture-selection, .instructions, .gto-overview, .olq-overview {
        padding: 30px 20px;
    }
    
    .test-selection h2, .picture-selection h2, .instructions h2, .gto-overview h2, .olq-overview h2 {
        font-size: 1.8rem;
    }
    
    .test-grid, .gto-tasks-grid, .olq-factors-grid {
        grid-template-columns: 1fr;
    }
    
    .current-word { font-size: 3rem; padding: 30px 15px; }
    .situation-display { padding: 25px 15px; }
    .situation-text { font-size: 1.2rem; }
}
/* =========================
GTO + OLQ FINAL FIX
========================= */

/* Fix ALL list containers */
.task-process ol,
.task-tips ul,
.assessment-criteria ul,
.sample-content ul,
.preparation-tips ul,
.leadership-tips ul,
.challenges ul,
.factor-development ul {
  margin-left: 22px;
  margin-top: 10px;
  margin-bottom: 20px;
  padding-left: 10px;
}

/* Fix list items */
.task-process li,
.task-tips li,
.assessment-criteria li,
.sample-content li,
.preparation-tips li,
.leadership-tips li,
.challenges li,
.factor-development li {
  margin-bottom: 10px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Improve headings */
.task-description h4,
.task-process h4,
.task-tips h4,
.assessment-criteria h4,
.sample-content h4,
.factor-description h4,
.factor-qualities-detailed h4,
.factor-development h4 {
  color: var(--accent);
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

/* Improve spacing between sections */
.task-description,
.task-process,
.task-tips,
.assessment-criteria,
.sample-content,
.preparation-tips,
.leadership-tips,
.challenges,
.factor-description,
.factor-qualities-detailed,
.factor-development {
  margin-bottom: 20px;
}

/* OLQ quality cards (important) */
.quality-card {
  background: rgba(255,255,255,0.03);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
}

.quality-card h5 {
  color: var(--accent);
  margin-bottom: 6px;
}