/* ==========================================================================
   Global Variables & Reset
   ========================================================================== */
:root {
    --primary-color: #0d47a1;
    --primary-light: #1976d2;
    --secondary-color: #2c3e50;
    --accent-color: #ff9800;
    --success-color: #1cc88a;
    --danger-color: #e74a3b;
    --bg-light: #f4f7f6;
    --text-dark: #333333;
    --text-muted: #6c757d;
}

body {
    background-color: var(--bg-light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Hero Section & Header (index.php)
   ========================================================================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 60px 0 80px 0;
    border-radius: 0 0 30px 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(13, 71, 161, 0.2);
}

.hero-section h1 {
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 15px;
}

.hero-section p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ==========================================================================
   Cards & Containers
   ========================================================================== */
.card-custom {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff;
}

/* Pull the main form card up into the hero section slightly */
.form-card-overlap {
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */
.form-label {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 12px 15px;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.25rem rgba(25, 118, 210, 0.15);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    padding: 12px 20px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(25, 118, 210, 0.3);
}

/* ==========================================================================
   Animations & Loaders
   ========================================================================== */
.loader {
    display: none; /* Hidden by default, shown via JS */
    width: 3rem;
    height: 3rem;
    color: var(--primary-light);
}

.fade-in {
    animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Result Page Specifics (result.php)
   ========================================================================== */
.score-badge {
    background: rgba(25, 118, 210, 0.1);
    color: var(--primary-color);
    padding: 15px 20px;
    border-radius: 12px;
    display: inline-block;
    border: 1px solid rgba(25, 118, 210, 0.2);
}

.score-badge h2 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
}

.stat-box {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    height: 100%;
}

.stat-box.correct { border-bottom: 4px solid var(--success-color); }
.stat-box.incorrect { border-bottom: 4px solid var(--danger-color); }
.stat-box.unattempted { border-bottom: 4px solid var(--text-muted); }

.stat-box .count {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

/* Table styling for detailed question view */
.table-custom th {
    background-color: var(--secondary-color);
    color: white;
    font-weight: 600;
    border: none;
}

.table-custom td {
    vertical-align: middle;
}

.status-correct { color: var(--success-color); font-weight: bold; }
.status-wrong { color: var(--danger-color); font-weight: bold; }
.status-ignored { color: var(--text-muted); }