/* Modern Light-Themed Design Styling with HSL Palettes */
:root {
    --primary: 224, 76%, 42%;
    /* Deep Cobalt Blue */
    --primary-light: 217, 91%, 55%;
    /* Royal Blue */
    --secondary: 162, 84%, 28%;
    /* Rich Forest Teal */
    --accent: 343, 89%, 48%;
    /* Crimson Accent */
    --bg-page: 210, 40%, 96%;
    /* Light Ice Blue Background */
    --bg-card: 0, 0%, 100%;
    /* Crisp White Card */
    --border-color: 214, 32%, 91%;
    /* Soft Border Gray */
    --border-glass: 214, 32%, 84%;
    /* Slightly darker glass structure edge */

    --text-primary: 222, 47%, 12%;
    /* Slate Charcoal */
    --text-secondary: 215, 25%, 34%;
    /* Muted Slate */
    --text-muted: 215, 16%, 54%;
    /* Cool Gray */

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 40px -8px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

/* General Layout Resets */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: hsl(var(--bg-page));
    color: hsl(var(--text-primary));
    font-family: 'Outfit', 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Color bar at top */
.decor-bar {
    height: 6px;
    background: linear-gradient(90deg,
            hsla(var(--primary), 1) 0%,
            hsla(var(--secondary), 1) 50%,
            hsla(var(--accent), 1) 100%);
    width: 100%;
}

/* Header UI */
.app-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid hsla(var(--border-glass), 0.7);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.15);
}

.logo-text {
    color: hsl(var(--text-primary));
}

.logo-text span {
    color: hsla(var(--secondary), 1);
    font-weight: 500;
}

.header-badge {
    background: hsla(var(--primary), 0.08);
    border: 1px solid hsla(var(--primary-light), 0.25);
    color: hsla(var(--primary), 1);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: hsla(var(--secondary), 1);
    border-radius: 50%;
    box-shadow: 0 0 8px hsla(var(--secondary), 0.8);
    animation: pulse 1.8s infinite;
}

/* Footer UI */
.app-footer {
    margin-top: auto;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid hsla(var(--border-glass), 0.4);
    color: hsl(var(--text-muted));
    font-size: 0.9rem;
}

.footer-note {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: hsla(var(--secondary), 0.9);
    font-weight: 600;
}

/* Content Area */
.app-content {
    max-width: 1000px;
    width: 100%;
    margin: 3rem auto;
    padding: 0 1.5rem;
    flex-grow: 1;
}

/* Premium Card design */
.premium-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    border: 1px solid hsla(var(--border-glass), 0.7);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

/* Page Title gradient texts */
.page-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, hsl(var(--primary)) 0%, hsla(var(--primary-light), 0.9) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-subtitle {
    color: hsl(var(--text-secondary));
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: hsl(var(--text-secondary));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label i {
    color: hsla(var(--primary-light), 1);
}

.form-control {
    background-color: white;
    border: 1px solid hsla(var(--border-glass), 0.95);
    border-radius: var(--radius-sm);
    color: hsl(var(--text-primary));
    font-family: inherit;
    font-size: 1.05rem;
    padding: 0.9rem 1.2rem;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: hsla(var(--primary-light), 0.8);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08), var(--shadow-glow);
}

/* Error/Notification Banners */
.alert-danger {
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.25);
    color: #991b1b;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Premium Buttons Styling */
.btn-primary {
    background: linear-gradient(135deg, hsla(var(--primary), 1) 0%, hsla(var(--primary-light), 1) 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1rem 2rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.18);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.28);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    border: 1px solid hsla(var(--border-glass), 0.95);
    border-radius: var(--radius-sm);
    color: hsl(var(--text-secondary));
    cursor: pointer;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.9rem 1.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: hsla(var(--text-secondary), 0.6);
    color: hsl(var(--text-primary));
}

/* Rules / Instructions list */
.rules-list {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rule-item {
    display: flex;
    gap: 1rem;
    background: hsla(var(--primary), 0.03);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid hsla(var(--primary-light), 0.9);
    border-top: 1px solid hsla(var(--border-glass), 0.25);
    border-bottom: 1px solid hsla(var(--border-glass), 0.25);
    border-right: 1px solid hsla(var(--border-glass), 0.25);
}

.rule-icon {
    font-size: 1.25rem;
    color: hsla(var(--primary), 1);
}

.rule-text h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: hsl(var(--text-primary));
}

.rule-text p {
    font-size: 0.9rem;
    color: hsl(var(--text-secondary));
}

/* Exam Dashboard structures */
.exam-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

@media (max-width: 900px) {
    .exam-layout {
        grid-template-columns: 1fr;
    }
}

.exam-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Head Panel counter clock */
.timer-card {
    background-color: white;
    border: 1px solid hsla(var(--border-glass), 0.85);
    padding: 1.25rem 1.75reM;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.timer-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.timer-icon {
    font-size: 1.5rem;
    color: hsla(var(--secondary), 1);
    animation: flash 2s infinite;
}

.timer-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: hsl(var(--text-muted));
}

.timer-countdown {
    font-size: 2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: hsl(var(--text-primary));
}

.timer-warning .timer-countdown {
    color: hsla(var(--accent), 1);
}

.timer-warning .timer-icon {
    color: hsla(var(--accent), 1);
    animation: flash 0.8s infinite;
}

.student-bar-details {
    font-size: 0.95rem;
    color: hsl(var(--text-secondary));
}

.student-bar-details strong {
    color: hsl(var(--text-primary));
}

/* Question sheet layout card */
.question-card {
    background-color: white;
    border: 1px solid hsla(var(--border-glass), 0.85);
    border-radius: var(--radius-md);
    padding: 2.25rem;
    box-shadow: var(--shadow-sm);
    display: none;
}

.question-card.active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.question-no {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    color: hsla(var(--secondary), 0.9);
    margin-bottom: 0.5rem;
    letter-spacing: 1.5px;
}

.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

/* Choice option list */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.option-wrapper {
    position: relative;
}

.option-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: hsla(var(--bg-page), 0.3);
    border: 1px solid hsla(var(--border-glass), 0.7);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
    font-size: 1.05rem;
    user-select: none;
}

.option-badge {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: white;
    border: 1px solid hsla(var(--border-glass), 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: hsl(var(--text-secondary));
    transition: all 0.2s ease;
}

.option-desc {
    color: hsl(var(--text-primary));
    transition: all 0.2s ease;
}

/* Hover transitions */
.option-label:hover {
    background-color: hsla(var(--primary-light), 0.04);
    border-color: hsla(var(--primary-light), 0.35);
}

.option-label:hover .option-badge {
    border-color: hsla(var(--primary-light), 0.4);
    color: hsl(var(--primary-light));
}

/* Selected input designs */
.option-input:checked+.option-label {
    background-color: hsla(var(--primary), 0.08);
    border-color: hsla(var(--primary), 0.8);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.08);
}

.option-input:checked+.option-label .option-badge {
    background: linear-gradient(135deg, hsla(var(--primary), 1) 0%, hsla(var(--primary-light), 1) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.2);
}

.option-input:checked+.option-label .option-desc {
    color: hsl(var(--primary));
    font-weight: 600;
}

/* Navigation rows */
.quiz-nav-row {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

/* Sidebar structure */
.sidebar-card {
    background-color: white;
    border: 1px solid hsla(var(--border-glass), 0.85);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: hsl(var(--text-primary));
}

.sidebar-title i {
    color: hsla(var(--secondary), 1);
}

/* Numeric question grid selectors */
.question-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.nav-idx-btn {
    aspect-ratio: 1;
    background-color: hsla(var(--bg-page), 0.4);
    border: 1px solid hsla(var(--border-glass), 0.85);
    color: hsl(var(--text-secondary));
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-idx-btn:hover {
    border-color: hsla(var(--primary-light), 0.6);
    color: hsl(var(--primary-light));
    background-color: white;
}

.nav-idx-btn.answered {
    background-color: hsla(var(--secondary), 0.08);
    border-color: hsla(var(--secondary), 0.85);
    color: hsl(var(--secondary));
}

.nav-idx-btn.active {
    background-color: hsla(var(--primary), 0.08);
    border-color: hsla(var(--primary), 0.85);
    color: hsl(var(--primary));
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.15);
}

/* Legends indicator */
.status-legends {
    padding-top: 1rem;
    border-top: 1px solid hsla(var(--border-glass), 0.7);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    font-size: 0.85rem;
    color: hsl(var(--text-secondary));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.legend-dot.empty {
    background-color: hsla(var(--bg-page), 0.4);
    border: 1px solid hsla(var(--border-glass), 0.85);
}

.legend-dot.current {
    background-color: hsla(var(--primary), 0.08);
    border: 1px solid hsla(var(--primary), 0.85);
}

.legend-dot.filled {
    background-color: hsla(var(--secondary), 0.08);
    border: 1px solid hsla(var(--secondary), 0.85);
}

/* Results metrics visualizers */
.result-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.score-badge-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: white;
    border: 6px solid hsla(var(--primary), 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto 1rem;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.08);
}

.score-value {
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 1;
    color: hsl(var(--primary));
}

.score-label {
    font-size: 0.85rem;
    color: hsl(var(--text-muted));
    text-transform: uppercase;
    margin-top: 0.2rem;
    letter-spacing: 1px;
}

.score-success {
    border-color: hsla(var(--secondary), 0.8);
    box-shadow: 0 5px 20px rgba(15, 118, 110, 0.1);
}

.score-success .score-value {
    color: hsla(var(--secondary), 1);
}

.score-fail {
    border-color: hsla(var(--accent), 0.7);
    box-shadow: 0 5px 20px rgba(220, 38, 38, 0.1);
}

.score-fail .score-value {
    color: hsla(var(--accent), 1);
}

/* Score breakdowns columns */
.score-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2.5rem 0;
}

@media(max-width: 600px) {
    .score-stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-item-box {
    background: white;
    border: 1px solid hsla(var(--border-glass), 0.8);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: hsl(var(--text-primary));
}

.stat-lbl {
    font-size: 0.8rem;
    color: hsl(var(--text-muted));
    text-transform: uppercase;
    margin-top: 0.2rem;
}

.stat-lbl i {
    margin-right: 0.25rem;
}

.stat-correct {
    border-bottom: 3.5px solid hsla(var(--secondary), 1);
}

.stat-incorrect {
    border-bottom: 3.5px solid hsla(var(--accent), 1);
}

.stat-unanswered {
    border-bottom: 3.5px solid hsla(var(--text-muted), 1);
}

/* Certificate details preview segment */
.certificate-section-preview {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid hsla(var(--border-glass), 0.8);
    text-align: center;
    background: linear-gradient(180deg, hsla(var(--primary), 0.02) 0%, transparent 100%);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
}

.certificate-preview-text {
    font-size: 0.95rem;
    color: hsl(var(--text-secondary));
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.results-action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Core keyframe animations */
@keyframes pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.4);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(15, 118, 110, 0);
    }

    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(15, 118, 110, 0);
    }
}

@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grid Layout Class */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Responsive / Mobile Styling Adjustments */
@media (max-width: 900px) {
    .logo-text {
        font-size: 0.9rem !important;
        line-height: 1.2;
    }
}

@media (max-width: 768px) {
    .app-content {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }
    
    .exam-layout {
        gap: 1.5rem;
    }
    
    .premium-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 600px) {
    .header-container {
        padding: 0.75rem 1rem;
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    .logo-img {
        width: 48px;
        height: 48px;
    }
    
    .logo-text {
        font-size: 0.75rem !important;
        line-height: 1.15;
    }
    
    .header-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.55rem;
        white-space: nowrap;
    }
    
    .grid-2-col {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .premium-card {
        padding: 1.5rem 1.15rem;
    }
    
    .question-card {
        padding: 1.5rem 1.15rem;
    }
    
    .question-text {
        font-size: 1.15rem;
        margin-bottom: 1.25rem;
    }
    
    .option-label {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .option-badge {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .timer-card {
        padding: 0.85rem 1.15rem;
    }
    
    .timer-countdown {
        font-size: 1.6rem;
    }
    
    .quiz-nav-row {
        gap: 0.75rem;
    }
    
    .quiz-nav-row button {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .score-badge-circle {
        width: 140px;
        height: 140px;
    }
    
    .score-value {
        font-size: 2.75rem;
    }
    
    .results-action-buttons {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .results-action-buttons .btn-primary,
    .results-action-buttons .btn-secondary {
        width: 100%;
        padding: 0.85rem 1.5rem;
        font-size: 0.95rem;
        display: flex;
    }
    
    .stat-item-box {
        padding: 1rem;
    }
    
    .stat-val {
        font-size: 1.3rem;
    }
}

@media (max-width: 400px) {
    .header-container {
        padding: 0.5rem 0.75rem;
    }
    
    .logo-img {
        width: 38px;
        height: 38px;
    }
    
    .logo-text {
        font-size: 0.68rem !important;
    }
    
    .header-badge {
        font-size: 0.68rem;
        padding: 0.2rem 0.4rem;
        gap: 0.25rem;
    }
    
    .premium-card {
        padding: 1.25rem 0.85rem;
    }
    
    .question-card {
        padding: 1.25rem 0.85rem;
    }
    
    .option-label {
        padding: 0.65rem 0.85rem;
        font-size: 0.9rem;
    }
}