/* ========================================
   CHAMPIONS LEAGUE EXAM SYSTEM - CSS
   Matches Maxicon Institute Design Language
   ======================================== */

:root {
    /* Maxicon Color Palette */
    --apex-orange: #f57c00;
    --apex-orange-dark: #e65100;
    --apex-orange-light: #fff3e0;
    --apex-orange-glow: rgba(245, 124, 0, 0.4);
    --apex-orange-glow-strong: rgba(245, 124, 0, 0.6);
    --apex-white: #ffffff;
    --apex-dark: #0a0a0f;
    --apex-gray-bg: #f8fafc;
    --apex-text-dark: #1a1a2e;
    --apex-text-muted: #64748b;
    --apex-shadow-sm: 0 10px 30px -10px rgba(0,0,0,0.05);
    --apex-shadow-md: 0 20px 40px -15px rgba(0,0,0,0.1);
    --apex-shadow-glow: 0 0 30px rgba(245, 124, 0, 0.15);
    --apex-border-glow: 1px solid rgba(245, 124, 0, 0.2);
    
    /* Exam Specific */
    --success-green: #10b981;
    --success-green-dark: #059669;
    --danger-red: #ef4444;
    --warning-amber: #f59e0b;
    --info-blue: #3b82f6;
}

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

body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #fef9f0 100%);
    color: var(--apex-text-dark);
    min-height: 100vh;
    line-height: 1.6;
}

/* ========================================
   TIMER BAR (Fixed Top)
   ======================================== */
.exam-timer-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: rgba(245, 124, 0, 0.1);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.exam-timer-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--apex-orange), #ff9f4a);
    transition: width 1s linear, background 0.3s ease;
    width: 100%;
    border-radius: 0 0 4px 4px;
}

.exam-timer-progress.warning { 
    background: linear-gradient(90deg, var(--warning-amber), #fbbf24); 
}
.exam-timer-progress.danger { 
    background: linear-gradient(90deg, var(--danger-red), #f87171); 
}

/* ========================================
   EXAM IMAGE BANNER
   Full-bleed hero built from the existing
   site photography (assets/img/1.jpg).
   ======================================== */
.exam-page-banner {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    width: 100%;
    /* Clears the fixed chrome: topbar (38px, in flow) + navbar (~66px) */
    margin-top: 66px;
    min-height: clamp(240px, 32vw, 400px);
    overflow: hidden;
    background-color: var(--apex-dark);
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.3);
}

/* Background photograph */
.exam-banner-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url("../img/1.jpg");
    background-size: cover;
    background-position: center 42%;
    background-repeat: no-repeat;
}

/* Darkening wash so the text stays legible over the photo, plus brand glow */
.exam-page-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(100deg, rgba(10, 10, 15, 0.94) 0%, rgba(10, 10, 15, 0.8) 40%, rgba(10, 10, 15, 0.34) 72%, rgba(10, 10, 15, 0.6) 100%),
        radial-gradient(circle at 82% 28%, rgba(245, 124, 0, 0.28) 0%, transparent 55%);
}

/* Bottom accent rule that ties the banner to the page accent */
.exam-page-banner::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    z-index: 2;
    background: linear-gradient(90deg, var(--apex-orange) 0%, #ffb347 45%, transparent 100%);
}

/* Inner box matches .exam-container so banner copy lines up with the card below */
.exam-banner-inner {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.exam-banner-copy {
    min-width: 0;
}

.exam-banner-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    margin-bottom: 14px;
    border-radius: 60px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--apex-white);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.exam-banner-badge i {
    color: var(--apex-orange);
}

.exam-banner-title {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--apex-white);
    margin: 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
}

.exam-banner-accent {
    background: linear-gradient(135deg, #f57c00 0%, #ffb347 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.exam-banner-subtitle {
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    margin: 0.6rem 0 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.exam-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 11px 26px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--apex-white);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.exam-banner-btn:hover {
    background: var(--apex-orange);
    border-color: var(--apex-orange);
    color: var(--apex-white);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 124, 0, 0.4);
}

/* ========================================
   CONTAINER
   ======================================== */
.exam-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* ========================================
   PROGRESS STEPS
   ======================================== */
.exam-progress-steps {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    position: relative;
}

.exam-progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.exam-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    flex: 1;
    max-width: 120px;
}

.exam-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--apex-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.exam-progress-step.active .exam-step-circle {
    background: linear-gradient(135deg, var(--apex-orange), var(--apex-orange-dark));
    color: var(--apex-white);
    box-shadow: 0 4px 15px rgba(245, 124, 0, 0.3);
    transform: scale(1.1);
}

.exam-progress-step.completed .exam-step-circle {
    background: var(--success-green);
    color: var(--apex-white);
}

.exam-step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--apex-text-muted);
    text-align: center;
    white-space: nowrap;
}

.exam-progress-step.active .exam-step-label {
    color: var(--apex-orange);
    font-weight: 600;
}

.exam-progress-step.completed .exam-step-label {
    color: var(--success-green);
}

/* ========================================
   ALERTS
   ======================================== */
.exam-alert {
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border: none;
    box-shadow: var(--apex-shadow-sm);
}

.exam-alert-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid var(--success-green);
    color: #065f46;
}

.exam-alert-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid var(--danger-red);
    color: #991b1b;
}

.exam-alert-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid var(--warning-amber);
    color: #92400e;
}

.exam-alert-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid var(--info-blue);
    color: #1e40af;
}

/* ========================================
   EXAM CARD
   ======================================== */
.exam-card {
    background: var(--apex-white);
    border-radius: 20px;
    box-shadow: var(--apex-shadow-md);
    border: var(--apex-border-glow);
    overflow: hidden;
}

.exam-header {
    background: linear-gradient(135deg, var(--apex-dark) 0%, #1a1a2e 100%);
    color: var(--apex-white);
    padding: 32px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.exam-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(245, 124, 0, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.exam-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    position: relative;
    z-index: 1;
}

.exam-header h1 i {
    color: var(--apex-orange);
    margin-right: 0.5rem;
}

.exam-subtitle {
    opacity: 0.85;
    margin-top: 8px;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.exam-timer-display {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-top: 16px;
    font-family: 'Space Grotesk', 'Inter', monospace;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(245, 124, 0, 0.3);
}

.exam-body {
    padding: 32px;
}

/* ========================================
   QUESTION CARD
   ======================================== */
.question-card {
    background: var(--apex-gray-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.question-card:hover {
    box-shadow: var(--apex-shadow-sm);
    border-color: rgba(245, 124, 0, 0.2);
}

.question-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-type-badge.mcq {
    background: #dbeafe;
    color: #1e40af;
}

.question-type-badge.mcq::before {
    content: '\f02d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
}

.question-type-badge.answerable {
    background: #e0e7ff;
    color: #3730a3;
}

.question-type-badge.answerable::before {
    content: '\f1dd';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
}

.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--apex-text-dark);
    line-height: 1.5;
    margin-bottom: 20px;
}

.question-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--apex-shadow-sm);
    background: var(--apex-white);
    padding: 8px;
}

/* ========================================
   OPTIONS GRID (MCQ)
   ======================================== */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 480px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

.option-btn {
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: var(--apex-white);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    font-size: 0.95rem;
    color: var(--apex-text-dark);
    font-family: inherit;
    font-weight: 500;
}

.option-btn:hover {
    border-color: var(--apex-orange);
    background: #fff8f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 124, 0, 0.15);
}

.option-btn:focus {
    outline: none;
    border-color: var(--apex-orange);
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.2);
}

.option-btn.selected {
    border-color: var(--apex-orange);
    background: linear-gradient(135deg, #fff8f0 0%, #fff3e0 100%);
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.15), 0 4px 12px rgba(245, 124, 0, 0.1);
}

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--apex-text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-btn.selected .option-letter {
    background: linear-gradient(135deg, var(--apex-orange), var(--apex-orange-dark));
    color: var(--apex-white);
}

.option-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   ANSWER TEXTAREA (Answerable)
   ======================================== */
.answer-textarea {
    width: 100%;
    min-height: 160px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    resize: vertical;
    transition: all 0.2s ease;
    line-height: 1.7;
    background: var(--apex-white);
}

.answer-textarea:focus {
    outline: none;
    border-color: var(--apex-orange);
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.15);
}

.answer-textarea::placeholder {
    color: var(--apex-text-muted);
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */
.exam-submit-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--apex-orange), var(--apex-orange-dark));
    border: none;
    color: var(--apex-white);
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(245, 124, 0, 0.3);
}

.exam-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 124, 0, 0.4);
}

.exam-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.exam-submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.3), 0 8px 25px rgba(245, 124, 0, 0.4);
}

.exam-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.exam-submit-btn i {
    font-size: 1.1rem;
}

/* ========================================
   REGISTRATION FORM
   ======================================== */
.registration-form .form-label {
    font-weight: 500;
    color: var(--apex-text-dark);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.registration-form .form-control,
.registration-form .form-select {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--apex-white);
}

.registration-form .form-control:focus,
.registration-form .form-select:focus {
    border-color: var(--apex-orange);
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.15);
    outline: none;
}

.registration-form .form-control.is-invalid,
.registration-form .form-select.is-invalid {
    border-color: var(--danger-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.registration-form .invalid-feedback {
    display: block;
    color: var(--danger-red);
    font-size: 0.8rem;
    margin-top: 4px;
}

.registration-form .form-control::placeholder {
    color: var(--apex-text-muted);
}

/* ========================================
   SUCCESS SCREEN
   ======================================== */
.success-card {
    text-align: center;
    padding: 48px 32px;
}

.success-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success-green), var(--success-green-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2.5rem;
    color: var(--apex-white);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.success-title {
    font-weight: 800;
    color: var(--apex-dark);
    margin-bottom: 8px;
    font-size: 1.75rem;
}

.success-message {
    color: var(--apex-text-muted);
    font-size: 1rem;
    margin-bottom: 20px;
}

.cl-number-display {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Space Grotesk', 'Inter', monospace;
    letter-spacing: 3px;
    background: linear-gradient(135deg, var(--apex-orange), var(--apex-orange-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 16px 0;
    animation: shine 2s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.success-note {
    color: var(--apex-text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    background: transparent;
    border: 2px solid var(--apex-orange);
    color: var(--apex-orange);
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-home:hover {
    background: var(--apex-orange);
    color: var(--apex-white);
    box-shadow: 0 0 15px rgba(245, 124, 0, 0.3);
    transform: translateY(-2px);
}

/* ========================================
   REGISTRATION HEADER (Green gradient)
   ======================================== */
.exam-header.success-header {
    background: linear-gradient(135deg, var(--success-green) 0%, var(--success-green-dark) 100%);
}

.exam-header.success-header::before {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
}

.exam-header.success-header .exam-timer-display {
    text-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .exam-container {
        padding: 16px 16px 40px;
    }
    
    .exam-header {
        padding: 24px 16px;
    }
    
    .exam-header h1 {
        font-size: 1.5rem;
    }
    
    .exam-timer-display {
        font-size: 1.75rem;
    }
    
    .exam-body {
        padding: 20px;
    }
    
    .question-card {
        padding: 16px;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .options-grid {
        gap: 10px;
    }
    
    .option-btn {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
    
    .option-letter {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
        margin-right: 10px;
    }
    
    .exam-progress-steps {
        gap: 12px;
    }
    
    .exam-progress-steps::before {
        left: 5%;
        right: 5%;
    }
    
    .exam-step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .exam-step-label {
        font-size: 0.7rem;
    }
    
    .success-icon {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .cl-number-display {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    /* Image banner: keep the photo readable when the layout stacks */
    .exam-page-banner {
        min-height: 0;
        padding: 0;
    }

    .exam-banner-media {
        background-position: 68% center;
    }

    .exam-page-banner::before {
        background:
            linear-gradient(180deg, rgba(10, 10, 15, 0.82) 0%, rgba(10, 10, 15, 0.7) 45%, rgba(10, 10, 15, 0.92) 100%),
            radial-gradient(circle at 78% 20%, rgba(245, 124, 0, 0.26) 0%, transparent 58%);
    }

    .exam-banner-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 34px 20px 38px;
    }

    .exam-banner-btn {
        padding: 10px 22px;
    }
}

@media (max-width: 480px) {
    .exam-banner-inner {
        padding: 28px 16px 32px;
    }

    .exam-banner-title {
        font-size: 1.7rem;
    }

    .exam-banner-subtitle {
        font-size: 0.85rem;
    }

    .exam-banner-badge {
        font-size: 0.68rem;
        padding: 5px 14px;
    }

    .exam-banner-btn {
        width: 100%;
        justify-content: center;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.exam-card {
    animation: fadeInUp 0.5s ease-out;
}

.question-card {
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.exam-submit-btn {
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .exam-timer-bar,
    .exam-page-banner,
    .exam-progress-steps,
    .exam-submit-btn,
    .btn-home {
        display: none !important;
    }
    
    .exam-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .exam-header {
        background: #1a1a2e !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .cl-number-display {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}