/* Global Styles for Cheelony Academy */

:root {
    --primary: #FFAC1C;
    --primary-soft: #ffe0a3;
    --primary-dark: #e08f00;
    --secondary: #3a4664;
    --secondary-soft: #505e80;
    --secondary-dark: #252c42;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fb;
    color: #1b2559;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}

/* Theme overrides so primary (#FFAC1C) is more dominant across the app and admin */
.h1, .h2, .h3, .h4, .h5, .h6,
h1, h2, h3, h4, h5, h6 {
    color: var(--secondary);
}

a {
    color: var(--secondary);
}

a:hover {
    color: var(--primary-dark);
}

.btn-primary,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:hover {
    background-color: var(--primary) !important;
    border-color: var(--primary-dark) !important;
    color: #111827 !important;
}

.btn-secondary,
.btn-secondary:focus,
.btn-secondary:active,
.btn-secondary:hover {
    background-color: var(--secondary) !important;
    border-color: var(--secondary-dark) !important;
    color: #ffffff !important;
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary) !important;
    border-color: var(--primary-dark) !important;
    color: #111827 !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.badge.bg-primary {
    background-color: var(--primary) !important;
}

/* Map other Bootstrap accents into brand palette so primary stands out */
.btn-success,
.btn-success:focus,
.btn-success:active,
.btn-success:hover {
    background-color: var(--secondary) !important;
    border-color: var(--secondary-dark) !important;
    color: #ffffff !important;
}

.btn-warning,
.btn-warning:focus,
.btn-warning:active,
.btn-warning:hover {
    background-color: var(--primary-soft) !important;
    border-color: var(--primary) !important;
    color: var(--secondary-dark) !important;
}

.btn-info,
.btn-info:focus,
.btn-info:active,
.btn-info:hover {
    background-color: var(--secondary-soft) !important;
    border-color: var(--secondary-dark) !important;
    color: #ffffff !important;
}

.btn-outline-secondary {
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary);
    color: #ffffff;
}

.btn-outline-success {
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-outline-success:hover {
    background-color: var(--secondary);
    border-color: var(--secondary-dark);
    color: #ffffff;
}

.btn-outline-warning {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.btn-outline-warning:hover {
    background-color: var(--primary);
    border-color: var(--primary-dark);
    color: #1f2937;
}

.badge.bg-success {
    background-color: var(--secondary) !important;
}

.badge.bg-warning {
    background-color: var(--primary-soft) !important;
    color: var(--secondary-dark) !important;
    line-height: 1.2;
}

.badge.bg-info {
    background-color: var(--secondary-soft) !important;
}

.bg-success {
    background-color: var(--secondary) !important;
}

.text-success {
    color: var(--secondary) !important;
}

.bg-info {
    background-color: var(--secondary-soft) !important;
}

.text-info {
    color: var(--secondary-soft) !important;
}

/* Main navigation */
.main-navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 12px 30px rgba(0, 0, 83, 0.12);
}

.main-navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--secondary);
}

.main-navbar .navbar-brand span.logo-mark {
    margin-right: 0.65rem;
}

.main-navbar .nav-link {
    position: relative;
    padding: 0.4rem 0.9rem;
    margin: 0 0.15rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #4b5563;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.main-navbar .nav-link::after {
    content: "";
    position: absolute;
    left: 0.9rem;
    right: 0.9rem;
    bottom: -0.25rem;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transform: scaleX(0.4);
    transform-origin: center;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.main-navbar .nav-link:hover,
.main-navbar .nav-link:focus {
    color: #111827;
}

.main-navbar .nav-link.active {
    color: #111827;
}

.main-navbar .nav-link.active::after {
    opacity: 1;
    transform: scaleX(1);
}

.main-navbar .btn-auth {
    border-radius: 999px;
    font-size: 0.9rem;
    padding-inline: 1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 83, 0.28);
}

.main-navbar .navbar-toggler {
    border: none;
}

.main-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.45);
}

.main-navbar .navbar-toggler-icon {
    background-image: none;
    position: relative;
    width: 1.35rem;
    height: 1.35rem;
}

.main-navbar .navbar-toggler-icon::before,
.main-navbar .navbar-toggler-icon::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 999px;
    background-color: #111827;
    transition: transform 0.18s ease, top 0.18s ease, bottom 0.18s ease;
}

.main-navbar .navbar-toggler-icon::before {
    top: 0.35rem;
}

.main-navbar .navbar-toggler-icon::after {
    bottom: 0.35rem;
}

.main-navbar .nav-link-search {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-soft));
    color: #ffffff !important;
    border-radius: 999px;
    padding: 0.5rem 1.2rem !important;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 83, 0.35);
}

.main-navbar .nav-link-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 83, 0.45);
    color: #ffffff !important;
}

/* Mobile-first ergonomics (touch targets, spacing, readable type) */
.btn {
    border-radius: 12px;
}

.btn-lg {
    padding: 0.9rem 1.1rem;
    border-radius: 14px;
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 12px;
    min-height: 44px; /* recommended touch target height */
}

.card {
    border-radius: 18px;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.98rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Navbar: easier tapping + better collapsed menu layout */
    .main-navbar .nav-link {
        padding: 0.75rem 0.9rem;
        border-radius: 12px;
    }

    .main-navbar .nav-link::after {
        display: none; /* reduce visual noise in collapsed view */
    }

    .main-navbar .navbar-collapse {
        padding: 0.75rem 0 1rem;
    }

    .main-navbar .nav-link-search {
        width: 100%;
        text-align: center;
        justify-content: center;
        margin-top: 0.25rem;
        padding: 0.75rem 1.1rem !important;
    }

    /* Cards/sections: tighter but still breathable */
    .hero-section {
        padding: 3.25rem 0 2rem;
    }

    .module-grid {
        padding: 0.75rem 0 2.5rem;
    }

    .module-card-people {
        height: 180px;
    }

    .module-card-body {
        padding: 1.2rem 1.1rem 1.35rem;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .popular-subjects-section,
    .recent-tests-section {
        padding: 3.25rem 0;
    }

    .action-links-section {
        padding: 2.75rem 0;
    }

    .action-link {
        padding: 1rem 1.25rem;
        border-radius: 14px;
        min-width: 0;
        width: 100%;
        max-width: 520px;
    }

    /* Tables: prevent cramping */
    .table td,
    .table th {
        white-space: nowrap;
    }
}

@media (max-width: 575.98px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .subject-card,
    .test-card {
        border-radius: 18px;
    }

    .subject-card {
        padding: 1.5rem;
    }

    .test-card-body {
        padding: 1.25rem;
    }

    .media-item {
        padding: 1.05rem 1.1rem;
    }
}

/* Mobile bottom quick actions bar */
.mobile-quickbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 -14px 35px rgba(58, 70, 100, 0.18);
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-quickbar__inner {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 0.75rem;
    align-items: end;
    padding: 0.65rem 0.25rem;
}

.mq-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-decoration: none;
    color: rgba(58, 70, 100, 0.92);
    font-weight: 650;
    font-size: 0.78rem;
    padding: 0.35rem 0.25rem;
    border-radius: 14px;
}

.mq-item i {
    font-size: 1.05rem;
}

.mq-item.is-active {
    color: var(--secondary);
}

.mq-item--primary {
    color: var(--secondary);
}

.mq-item--primary .mq-fab {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary-soft) 100%);
    color: #0f172a;
    box-shadow: 0 12px 26px rgba(255, 172, 28, 0.25), 0 12px 26px rgba(58, 70, 100, 0.18);
    transform: translateY(-10px);
}

.mq-item--primary.is-active .mq-fab {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

@media (max-width: 767.98px) {
    body.has-mobile-quickbar {
        padding-bottom: calc(90px + env(safe-area-inset-bottom));
    }
}

.navbar-brand span.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    margin-right: 0.5rem;
}

.navbar-brand .brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 172, 28, 0.12);
}

.navbar-brand .brand-wordmark {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.hero-section {
    padding: 5rem 0 3rem;
    text-align: center;
}

.hero-title {
    font-weight: 700;
    font-size: clamp(2.2rem, 3vw, 2.8rem);
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: #6b7280;
    max-width: 540px;
    margin: 0 auto;
}

.module-grid {
    padding: 1rem 0 3.5rem;
}

.module-card {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.module-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.14);
}

.module-card-header {
    position: relative;
    padding: 1.25rem 1.25rem 0;
}

.module-card-people {
    border-radius: 20px;
    overflow: hidden;
    height: 220px;
    background-size: cover;
    background-position: center center;
}

.module-card-body {
    padding: 1.5rem 1.5rem 1.75rem;
    text-align: center;
    background: #ffffff;
    border-radius: 20px 20px 24px 24px;
    margin-top: 1.25rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.module-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.9rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    color: #0f172a;
    background: rgba(148, 163, 184, 0.1);
}

.module-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.module-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Color themes for each module – full card color, clean and professional */

.module-school {
    background: linear-gradient(150deg, var(--secondary), var(--secondary-soft));
    color: #e5e7eb;
}

.module-school .module-pill {
    background: rgba(0, 0, 0, 0.3);
    color: #e5e7eb;
}

.module-school .module-title {
    color: #f9fafb;
}

.module-school .module-subtitle {
    color: rgba(249, 250, 251, 0.82);
}

.module-school .module-card-people {
    background-image: url('../images/students.jpg');
}

/* Ensure strong, readable text on white body for school card */
.module-school .module-card-body {
    color: #1f2937;
}

.module-school .module-card-body .module-title {
    color: var(--primary);
}

.module-school .module-card-body .module-subtitle {
    color: #4b5563;
}

.module-notices {
    /* Balanced primary + secondary */
    background: linear-gradient(150deg, var(--secondary) 0%, var(--primary) 100%);
    color: rgba(255, 255, 255, 0.92);
}

.module-notices .module-pill {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.92);
}

.module-notices .module-title {
    color: #ffffff;
}

.module-notices .module-subtitle {
    color: rgba(255, 255, 255, 0.86);
}

.module-notices .module-card-people {
    background-image: url('../images/boy.jpg');
}

/* Strong text colors for notices card */
.module-notices .module-card-body {
    color: #1f2937;
}

.module-notices .module-card-body .module-title {
    color: var(--secondary);
}

.module-notices .module-card-body .module-subtitle {
    color: #4b5563;
}

.module-lostnfound {
    background: linear-gradient(150deg, var(--secondary), #343a8a);
    color: #e0e7ff;
}

.module-lostnfound .module-pill {
    background: rgba(0, 0, 0, 0.3);
    color: #e0e7ff;
}

.module-lostnfound .module-title {
    color: #eef2ff;
}

.module-lostnfound .module-subtitle {
    color: rgba(238, 242, 255, 0.86);
}

.module-lostnfound .module-card-people {
    background-image: url('../images/african-kid-enjoying-life.jpg');
}

/* Strong text colors for lost & found card */
.module-lostnfound .module-card-body {
    color: #111827;
}

.module-lostnfound .module-card-body .module-title {
    color: var(--primary);
}

.module-lostnfound .module-card-body .module-subtitle {
    color: #4b5563;
}

.module-birthday {
    /* Balanced primary + secondary */
    background: linear-gradient(150deg, var(--primary-dark) 0%, var(--secondary-soft) 100%);
    color: rgba(255, 255, 255, 0.92);
}

.module-birthday .module-pill {
    background: rgba(0, 0, 0, 0.28);
    color: rgba(255, 255, 255, 0.92);
}

.module-birthday .module-title {
    color: #ffffff;
}

.module-birthday .module-subtitle {
    color: rgba(255, 255, 255, 0.86);
}

.module-birthday .module-card-people {
    background-image: url('../images/woman.jpg');
}

/* Strong text colors for birthday card */
.module-birthday .module-card-body {
    color: #1f2937;
}

.module-birthday .module-card-body .module-title {
    color: var(--secondary);
}

.module-birthday .module-card-body .module-subtitle {
    color: #4b5563;
}

/* Mega Footer Styles */
.mega-footer {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 60%, #020617 100%);
    color: #e2e8f0;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-section {
    margin-bottom: 2rem;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-title::before {
    content: "";
    width: 4px;
    height: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 2px;
}

.footer-description {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0;
}

.footer-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
    transform: translateX(4px);
}

.footer-links a i {
    width: 20px;
    color: #64748b;
    transition: color 0.2s ease;
}

.footer-links a:hover i {
    color: var(--primary);
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.footer-contact li i {
    color: var(--primary);
    font-size: 1.1rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.footer-contact li a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-contact li a:hover {
    color: #ffffff;
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.footer-copyright {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
}

.footer-legal {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.footer-legal a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-legal a:hover {
    color: #ffffff;
}

.footer-legal .separator {
    color: #475569;
}

/* Action Links Section */
.action-links-section {
    padding: 4rem 0;
    /* More balanced (less orange wash) */
    background: linear-gradient(
        135deg,
        rgba(58, 70, 100, 0.12) 0%,
        #fdfdfd 50%,
        rgba(255, 172, 28, 0.12) 100%
    );
}

.action-links-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2rem;
    background: #ffffff;
    border-radius: 16px;
    text-decoration: none;
    color: #1f2937;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 200px;
    justify-content: space-between;
}

.action-link i:first-child {
    font-size: 1.3rem;
    color: var(--secondary);
}

.action-link i:last-child {
    font-size: 0.9rem;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.action-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
    color: #1f2937;
}

.action-link:hover i:last-child {
    opacity: 1;
    transform: translateX(4px);
}

.action-link-portal {
    border-color: var(--secondary);
}

.action-link-portal:hover {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-soft));
    color: #ffffff;
}

.action-link-portal:hover i {
    color: #ffffff;
}

.action-link-login {
    border-color: var(--primary);
}

.action-link-login:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
}

.action-link-login:hover i {
    color: #ffffff;
}

.action-link-signup {
    border-color: var(--secondary);
}

.action-link-signup:hover {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-soft));
    color: #ffffff;
}

.action-link-signup:hover i {
    color: #ffffff;
}

/* Popular Subjects Section */
.popular-subjects-section {
    padding: 5rem 0;
    background: #ffffff;
}

.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.75rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #4b5563;
    max-width: 600px;
    margin: 0 auto;
}

.subject-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.subject-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
    border-color: #cbd5e1;
}

.subject-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.subject-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    flex: 1;
}

.subject-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-soft));
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.subject-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.subject-description {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.subject-link {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    margin-top: auto;
}

.subject-link:hover {
    color: var(--primary);
    gap: 0.5rem;
}

.subject-link i {
    transition: transform 0.2s ease;
}

.subject-link:hover i {
    transform: translateX(4px);
}

/* Recently Added Tests Section */
.recent-tests-section {
    padding: 5rem 0;
    /* Balanced (reduce orange dominance) */
    background: linear-gradient(
        135deg,
        rgba(58, 70, 100, 0.10) 0%,
        #f1f5f9 60%,
        rgba(255, 172, 28, 0.10) 100%
    );
}

.test-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.test-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
    border-color: #cbd5e1;
}

.test-card-header {
    padding: 1.25rem 1.5rem 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.test-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.test-badge-subject {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-soft));
    color: #ffffff;
}

.test-badge-grade {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
}

.test-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.test-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.test-meta {
    margin-bottom: 1.5rem;
    flex: 1;
}

.test-date {
    display: inline-flex;
    align-items: center;
    color: #64748b;
    font-size: 0.9rem;
}

.test-date i {
    color: #94a3b8;
}

.test-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-soft));
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    margin-top: auto;
}

.test-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 83, 0.4);
    color: #ffffff;
}

/* Media Highlights Section (Glued PDFs & Videos) */
.media-highlights-section {
    padding: 4rem 0 1rem;
    /* Balanced (secondary + primary tint) */
    background: radial-gradient(
        circle at top left,
        rgba(58, 70, 100, 0.14) 0,
        #f9fafb 42%,
        rgba(255, 172, 28, 0.12) 100%
    );
}

.media-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.media-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
    box-shadow: 0 10px 30px rgba(0, 0, 83, 0.12);
    position: relative;
    overflow: hidden;
}

.media-item-main {
    flex: 1;
}

.media-title {
    font-size: 1.02rem;
    font-weight: 650;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.media-meta {
    color: #94a3b8;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.media-description {
    color: #64748b;
    max-width: 36rem;
}

.media-item-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.media-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 83, 0.22);
    border-color: var(--primary);
}

.media-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(0, 0, 83, 0.14), rgba(255, 172, 28, 0.12));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.media-item:hover::before {
    opacity: 1;
}

@media (max-width: 575.98px) {
    .hero-section {
        padding-top: 3.5rem;
    }

    .action-links-container {
        flex-direction: column;
        align-items: stretch;
    }

    .action-link {
        min-width: auto;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .media-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .media-item-actions {
        width: 100%;
        justify-content: flex-start;
    }
}


