/* ========== Global Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --hover-bg: #f3f4f6;
    --carousel-gap: 1.1rem;
    --carousel-items-visible: 4;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(140deg, #f8fafc 0%, #ffffff 45%, #f1f5f9 100%);
    min-height: 100vh;
    padding-bottom: 60px;
    position: relative;
}

:root {
    --nav-height: 50px;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(
            900px circle at 10% 18%,
            rgba(226, 232, 240, 0.6) 0%,
            rgba(226, 232, 240, 0.2) 35%,
            rgba(226, 232, 240, 0) 60%
        ),
        radial-gradient(
            800px circle at 90% 80%,
            rgba(226, 232, 240, 0.5) 0%,
            rgba(226, 232, 240, 0.18) 35%,
            rgba(226, 232, 240, 0) 60%
        ),
        linear-gradient(
            135deg,
            rgba(203, 213, 225, 0.18) 0%,
            rgba(255, 255, 255, 0) 55%
        ),
        repeating-linear-gradient(
            0deg,
            rgba(148, 163, 184, 0.05) 0 1px,
            rgba(255, 255, 255, 0) 1px 140px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(148, 163, 184, 0.04) 0 1px,
            rgba(255, 255, 255, 0) 1px 140px
        );
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* ========== Navigation Header ========== */
.navbar {
    background: #ffffff;
    padding: 0.7rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.28s ease;
}

.nav-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem 1.5rem;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
    min-width: 0;
}

.brand-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.logo-icon {
    font-size: 2.2rem;
    color: #6366f1;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(-5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(-5px) rotate(5deg);
    }
}

.brand-name {
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
}

.nav-right {
    display: flex;
    gap: 0.9rem 1.4rem;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
    flex-wrap: wrap;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 0.25rem;
    border-radius: 0;
    border: none;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    box-shadow: none;
    transition: all 0.2s ease;
}

.nav-toggle i {
    font-size: 1.3rem;
    color: var(--text-color);
}

.nav-toggle:hover {
    background: transparent;
    box-shadow: none;
}

.nav-toggle:hover i {
    color: var(--primary-color);
}

.nav-toggle:active {
    transform: scale(0.95);
}

.sidebar-overlay {
    position: fixed;
    inset: var(--nav-height) 0 0 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1200;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: calc(100vh - var(--nav-height));
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1300;
    padding: 1.2rem 1rem 2rem;
    overflow-y: auto;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.sidebar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
}

.sidebar-close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    cursor: pointer;
}

.sidebar-close i {
    color: var(--text-light);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.sidebar-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 0.6rem 0.15rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.sidebar-link span {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-link i:first-child {
    color: var(--primary-color);
    font-size: 1.15rem;
}

.sidebar-caret {
    color: var(--text-light);
    font-size: 0.95rem;
    transition: transform 0.2s ease;
    font-weight: 700;
}

.sidebar-dropdown.open .sidebar-caret {
    transform: rotate(180deg);
}

.sidebar-submenu {
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem 0 0.8rem 1rem;
    margin-left: 0.3rem;
}

.sidebar-dropdown.open .sidebar-submenu {
    display: flex;
}

.sidebar-submenu a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.98rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0;
    transition: all 0.2s ease;
}

.sidebar-submenu a:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

.sidebar-submenu a i {
    color: var(--text-light);
    font-size: 1.05rem;
}

.sidebar-link:hover {
    color: var(--primary-color);
}

/* Plain sidebar link (no dropdown) — matches the .sidebar-link look but is an <a> */
.sidebar-plain-link {
    text-decoration: none;
    justify-content: flex-start;
}

.sidebar-plain-link i:first-child {
    color: #10b981;
}

/* Sidebar menu color accents */
.sidebar-dropdown:nth-child(1) .sidebar-link i:first-child {
    color: #8b5cf6;
}

.sidebar-dropdown:nth-child(2) .sidebar-link i:first-child {
    color: #f59e0b;
}

.sidebar-dropdown:nth-child(3) .sidebar-link i:first-child {
    color: #f97316;
}

.sidebar-dropdown:nth-child(4) .sidebar-link i:first-child {
    color: #3b82f6;
}

.sidebar-dropdown:nth-child(5) .sidebar-link i:first-child {
    color: #10b981;
}

/* Unique caret colors for each dropdown */
.sidebar-dropdown:nth-child(1) .sidebar-caret {
    color: #8b5cf6;
}

.sidebar-dropdown:nth-child(2) .sidebar-caret {
    color: #f59e0b;
}

.sidebar-dropdown:nth-child(3) .sidebar-caret {
    color: #f97316;
}

.sidebar-dropdown:nth-child(4) .sidebar-caret {
    color: #3b82f6;
}

.sidebar-dropdown:nth-child(5) .sidebar-caret {
    color: #10b981;
}

.sidebar-dropdown {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-dropdown:last-child {
    border-bottom: none;
}

/* Unique submenu icon colors per item */
.sidebar-dropdown:nth-child(1) .sidebar-submenu a:nth-of-type(1) i { color: #8b5cf6; }
.sidebar-dropdown:nth-child(1) .sidebar-submenu a:nth-of-type(2) i { color: #3b82f6; }
.sidebar-dropdown:nth-child(1) .sidebar-submenu a:nth-of-type(3) i { color: #0ea5e9; }
.sidebar-dropdown:nth-child(1) .sidebar-submenu a:nth-of-type(4) i { color: #22c55e; }
.sidebar-dropdown:nth-child(1) .sidebar-submenu a:nth-of-type(5) i { color: #f97316; }

.sidebar-dropdown:nth-child(2) .sidebar-submenu a:nth-of-type(1) i { color: #f59e0b; }
.sidebar-dropdown:nth-child(2) .sidebar-submenu a:nth-of-type(2) i { color: #f97316; }
.sidebar-dropdown:nth-child(2) .sidebar-submenu a:nth-of-type(3) i { color: #ec4899; }
.sidebar-dropdown:nth-child(2) .sidebar-submenu a:nth-of-type(4) i { color: #22c55e; }
.sidebar-dropdown:nth-child(2) .sidebar-submenu a:nth-of-type(5) i { color: #3b82f6; }

.sidebar-dropdown:nth-child(3) .sidebar-submenu a:nth-of-type(1) i { color: #f97316; }
.sidebar-dropdown:nth-child(3) .sidebar-submenu a:nth-of-type(2) i { color: #8b5cf6; }
.sidebar-dropdown:nth-child(3) .sidebar-submenu a:nth-of-type(3) i { color: #0ea5e9; }
.sidebar-dropdown:nth-child(3) .sidebar-submenu a:nth-of-type(4) i { color: #22c55e; }

.sidebar-dropdown:nth-child(4) .sidebar-submenu a:nth-of-type(1) i { color: #3b82f6; }
.sidebar-dropdown:nth-child(4) .sidebar-submenu a:nth-of-type(2) i { color: #f59e0b; }
.sidebar-dropdown:nth-child(4) .sidebar-submenu a:nth-of-type(3) i { color: #ef4444; }
.sidebar-dropdown:nth-child(4) .sidebar-submenu a:nth-of-type(4) i { color: #14b8a6; }
.sidebar-dropdown:nth-child(4) .sidebar-submenu a:nth-of-type(5) i { color: #6366f1; }

.sidebar-dropdown:nth-child(5) .sidebar-submenu a:nth-of-type(1) i { color: #10b981; }
.sidebar-dropdown:nth-child(5) .sidebar-submenu a:nth-of-type(2) i { color: #6366f1; }
.sidebar-dropdown:nth-child(5) .sidebar-submenu a:nth-of-type(3) i { color: #f97316; }
.sidebar-dropdown:nth-child(5) .sidebar-submenu a:nth-of-type(4) i { color: #ec4899; }

/* Dropdown Menu Styles */
.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.05rem;
    padding: 0.4rem 0.15rem;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.35);
    outline-offset: 4px;
}

.nav-link-button {
    border: none;
    background: transparent;
    font: inherit;
}

.nav-link i:first-child {
    font-size: 1.15rem;
}

/* Nav right icon colors — per position (4 dropdowns + Login link) */
.nav-right > .nav-dropdown:nth-child(1) > .nav-link > i:first-child { color: #8b5cf6; }
.nav-right > .nav-dropdown:nth-child(2) > .nav-link > i:first-child { color: #f59e0b; }
.nav-right > .nav-dropdown:nth-child(3) > .nav-link > i:first-child { color: #f97316; }
.nav-right > .nav-dropdown:nth-child(4) > .nav-link > i:first-child { color: #3b82f6; }
.nav-right > .nav-login-link > i:first-child { color: #10b981; }

.nav-profile-link {
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
}

.nav-profile-link i {
    font-size: 1.35rem;
}

/* ========== Nav Right Dropdowns ========== */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Natural, plain-white dropdown — like a native page menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 240px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
    z-index: 1200;
}

/* Hover-bridge: invisible strip so the mouse can travel from
   trigger to panel without losing hover. */
.dropdown-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
}

/* For the last (right-aligned) dropdown, pin it to the right so it
   doesn't spill off the viewport. */
.nav-dropdown-end .dropdown-menu {
    left: auto;
    right: 0;
    transform: translateY(-6px);
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-end:hover .dropdown-menu,
.nav-dropdown-end:focus-within .dropdown-menu,
.nav-dropdown-end.open .dropdown-menu {
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    transition: background 0.12s ease;
    white-space: nowrap;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
    flex-shrink: 0;
}

.dropdown-item:hover,
.dropdown-item:focus-visible {
    background: #f8fafc;
    color: var(--primary-color);
    outline: none;
}

.dropdown-item:hover i,
.dropdown-item:focus-visible i {
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    margin: 4px 6px;
    background: #e5e7eb;
    border: 0;
}

/* Rainbow icons — every dropdown item gets a distinct colour */
.nav-right .dropdown-menu .dropdown-item:nth-of-type(1) i { color: #8b5cf6; } /* violet   */
.nav-right .dropdown-menu .dropdown-item:nth-of-type(2) i { color: #ec4899; } /* pink     */
.nav-right .dropdown-menu .dropdown-item:nth-of-type(3) i { color: #f97316; } /* orange   */
.nav-right .dropdown-menu .dropdown-item:nth-of-type(4) i { color: #10b981; } /* emerald  */
.nav-right .dropdown-menu .dropdown-item:nth-of-type(5) i { color: #3b82f6; } /* blue     */
.nav-right .dropdown-menu .dropdown-item:nth-of-type(6) i { color: #eab308; } /* yellow   */
.nav-right .dropdown-menu .dropdown-item:nth-of-type(7) i { color: #dc2626; } /* red      */
.nav-right .dropdown-menu .dropdown-item:nth-of-type(8) i { color: #06b6d4; } /* cyan     */
.nav-right .dropdown-menu .dropdown-item:nth-of-type(9) i { color: #6366f1; } /* indigo   */

/* Login-panel dropdown gets its own accent to distinguish the panel section */
.nav-right .nav-dropdown-end .dropdown-menu .dropdown-item:nth-of-type(1) i { color: #10b981; } /* Sign In       — emerald */
.nav-right .nav-dropdown-end .dropdown-menu .dropdown-item:nth-of-type(2) i { color: #f59e0b; } /* Create        — amber   */
.nav-right .nav-dropdown-end .dropdown-menu .dropdown-item:nth-of-type(3) i { color: #8b5cf6; } /* Student Panel — violet  */
.nav-right .nav-dropdown-end .dropdown-menu .dropdown-item:nth-of-type(4) i { color: #ec4899; } /* Teacher Panel — pink    */
.nav-right .nav-dropdown-end .dropdown-menu .dropdown-item:nth-of-type(5) i { color: #f97316; } /* Office Panel  — orange  */
.nav-right .nav-dropdown-end .dropdown-menu .dropdown-item:nth-of-type(6) i { color: #dc2626; } /* Admin Panel   — red     */
.nav-right .nav-dropdown-end .dropdown-menu .dropdown-item:nth-of-type(7) i { color: #06b6d4; } /* District      — cyan    */
.nav-right .nav-dropdown-end .dropdown-menu .dropdown-item:nth-of-type(8) i { color: #6366f1; } /* Division      — indigo  */

/* Keep each icon's distinct colour on hover (override the generic hover rule) */
.nav-right .dropdown-menu .dropdown-item:hover i,
.nav-right .dropdown-menu .dropdown-item:focus-visible i {
    filter: brightness(0.92);
    transform: scale(1.1);
}
.nav-right .dropdown-menu .dropdown-item:nth-of-type(1):hover i,
.nav-right .dropdown-menu .dropdown-item:nth-of-type(1):focus-visible i { color: #8b5cf6; }
.nav-right .dropdown-menu .dropdown-item:nth-of-type(2):hover i,
.nav-right .dropdown-menu .dropdown-item:nth-of-type(2):focus-visible i { color: #ec4899; }
.nav-right .dropdown-menu .dropdown-item:nth-of-type(3):hover i,
.nav-right .dropdown-menu .dropdown-item:nth-of-type(3):focus-visible i { color: #f97316; }
.nav-right .dropdown-menu .dropdown-item:nth-of-type(4):hover i,
.nav-right .dropdown-menu .dropdown-item:nth-of-type(4):focus-visible i { color: #10b981; }
.nav-right .dropdown-menu .dropdown-item:nth-of-type(5):hover i,
.nav-right .dropdown-menu .dropdown-item:nth-of-type(5):focus-visible i { color: #3b82f6; }
.nav-right .dropdown-menu .dropdown-item:nth-of-type(6):hover i,
.nav-right .dropdown-menu .dropdown-item:nth-of-type(6):focus-visible i { color: #eab308; }
.nav-right .dropdown-menu .dropdown-item:nth-of-type(7):hover i,
.nav-right .dropdown-menu .dropdown-item:nth-of-type(7):focus-visible i { color: #dc2626; }
.nav-right .dropdown-menu .dropdown-item:nth-of-type(8):hover i,
.nav-right .dropdown-menu .dropdown-item:nth-of-type(8):focus-visible i { color: #06b6d4; }
.nav-right .dropdown-menu .dropdown-item:nth-of-type(9):hover i,
.nav-right .dropdown-menu .dropdown-item:nth-of-type(9):focus-visible i { color: #6366f1; }
/* Icon gently transitions when appearing */
.nav-right .dropdown-menu .dropdown-item i { transition: color .18s ease, transform .18s ease, filter .18s ease; }

body.sidebar-open {
    overflow: hidden;
}

/* ========== Search Section ========== */
.search-section {
    background: transparent;
    padding: 3rem 2rem 2rem 2rem;
    margin-top: 4.5rem;
}

.search-container {
    position: relative;
    max-width: 620px;
    width: 100%;
    margin: 0.9rem auto 1.8rem;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50px;
    padding: 0.25rem 0.25rem 0.25rem 1.2rem;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(6px);
}

.search-container:focus-within {
    border-color: #e0e0e0;
    box-shadow: none;
}

.search-icon {
    font-size: 1.15rem;
    color: #00796b;
    margin-right: 0.7rem;
}

.search-box {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    padding: 0.75rem 0.4rem;
    color: var(--text-color);
    background: transparent;
}

.search-box::placeholder {
    color: #9e9e9e;
    font-weight: 400;
}

.voice-icon {
    font-size: 1.05rem;
    color: var(--primary-color);
    margin: 0 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.voice-icon:hover {
    color: var(--secondary-color);
    transform: scale(1.1);
}

.search-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.search-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* ========== Carousel Section ========== */
.carousel-section {
    max-width: 620px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    position: relative;
    padding: 0.5rem 0;
}

.carousel-container {
    flex: 1;
    overflow: hidden;
    padding: 0.7rem 0;
}

.carousel-track {
    display: flex;
    gap: var(--carousel-gap);
    transition: transform 0.4s ease;
    justify-content: flex-start;
}

.carousel-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    min-width: 0;
    flex: 0 0 calc((100% - (var(--carousel-gap) * (var(--carousel-items-visible) - 1))) / var(--carousel-items-visible));
    padding: 0.45rem;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.carousel-item:hover {
    transform: translateY(-5px);
}

.carousel-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

.carousel-item:hover .carousel-icon {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    transform: scale(1.08);
    filter: saturate(1.08);
}

.carousel-icon i {
    font-size: 1.32rem;
    color: #ffffff;
}

.carousel-item:hover .carousel-icon i {
    color: #ffffff;
}

.carousel-item:nth-child(1) .carousel-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
}

.carousel-item:nth-child(2) .carousel-icon {
    background: linear-gradient(135deg, #22c55e 0%, #84cc16 100%);
}

.carousel-item:nth-child(3) .carousel-icon {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
}

.carousel-item:nth-child(4) .carousel-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
}

.carousel-item:nth-child(5) .carousel-icon {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
}

.carousel-item:nth-child(6) .carousel-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
}

.carousel-item:nth-child(7) .carousel-icon {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
}

.carousel-item:nth-child(8) .carousel-icon {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.carousel-item:nth-child(9) .carousel-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
}

.carousel-item:nth-child(10) .carousel-icon {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
}

.carousel-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

.carousel-btn {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    color: var(--text-light);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.carousel-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.carousel-btn i {
    font-size: 0.9rem;
}

/* ========== Education Levels Section ========== */
.education-levels {
    max-width: 1600px;                 /* Option C — matches .hero .container */
    margin: 1rem auto;
    padding: 2rem clamp(12px, 2vw, 24px);   /* Responsive: 12px mobile → 24px desktop */
}

/* One-line layout: Back button (left) + title/subtitle stack (right). */
.levels-heading {
    text-align: left;
    margin: 0.6rem 0 1.4rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    max-width: none;
    padding: 0;
    flex-wrap: nowrap;
}

/* Title + subtitle stack vertically inside their own column */
.levels-heading-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    min-width: 0;
    flex: 1 1 auto;
}

.levels-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
    display: inline-block;
    position: relative;
    padding-bottom: 12px;
    text-align: left;
}
.levels-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, #0891b2, #14b8a6);
}

.levels-subtitle {
    font-size: 0.98rem;
    color: var(--text-light);
    margin: 0.15rem 0 0;
    max-width: 640px;
    line-height: 1.55;
    font-weight: 500;
    text-align: left;
}

.levels-divider {
    display: none;
}

/* Back button is now the leading item in the same flex row */
.levels-toolbar {
    margin: 0;
    flex: 0 0 auto;
}

/* On narrow screens, wrap the text block below the button so it never crushes */
@media (max-width: 560px) {
    .levels-heading { flex-wrap: wrap; gap: 0.6rem; }
    .levels-title { font-size: 1.5rem; padding-bottom: 10px; }
    .levels-subtitle { font-size: 0.9rem; }
}

.levels-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-color);
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-2px);
    justify-content: center;
}

.levels-back-btn i {
    font-size: 0.95rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.levels-back-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.levels-back-btn:hover {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.15);
    transform: translateX(-3px);
}

.levels-back-btn:hover i {
    transform: translateX(-2px);
}

.levels-view {
    display: none;
}

.levels-view.active {
    display: block;
}

.levels-divider::before,
.levels-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 45%;
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(37, 99, 235, 0.1),
        rgba(99, 102, 241, 0.6)
    );
}

.levels-divider::before {
    left: 0;
}

.levels-divider::after {
    right: 0;
    transform: scaleX(-1);
}

.levels-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 2.4rem 1.8rem;
    padding: 0.5rem 0;
    justify-items: start;
}

/* Loading + empty state for the homepage class grid — content is
   managed from the Office panel so we may briefly show a loader or
   the empty state when the office team has not added anything yet. */
.levels-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}
.levels-loading i { font-size: 22px; color: #7c3aed; }
.levels-empty {
    text-align: center;
    padding: 48px 20px;
    color: #64748b;
    max-width: 480px;
    margin: 0 auto;
}
.levels-empty i {
    font-size: 40px;
    color: #cbd5e1;
    margin-bottom: 12px;
    display: block;
}
.levels-empty h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}
.levels-empty p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
}

.level-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 0.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.level-item:hover {
    transform: translateY(-10px);
}

.level-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.13);
}

.level-item:hover .level-icon {
    transform: rotate(360deg) scale(1.12);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.level-icon i {
    font-size: 1.75rem;
    color: white;
}

.level-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    margin-top: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.item-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 0.3rem;
    max-width: 150px;
    line-height: 1.4;
    font-weight: 500;
}

.lesson-details {
    width: min(100%, 920px);
    padding: 1.8rem 2rem;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    margin: 1rem 0 1.6rem;
}

.lesson-details.is-hidden {
    display: none;
}

.lesson-details-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text-color);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.lesson-details-text {
    color: var(--text-light);
    font-size: 1.02rem;
    line-height: 1.6;
    font-weight: 500;
}


/* ========== Individual Icon Colors ========== */
.level-item:nth-child(1) .level-icon {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.level-item:nth-child(2) .level-icon {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
}

.level-item:nth-child(3) .level-icon {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
}

.level-item:nth-child(4) .level-icon {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.level-item:nth-child(5) .level-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
}

.level-item:nth-child(6) .level-icon {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
}

.level-item:nth-child(7) .level-icon {
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
}

.level-item:nth-child(8) .level-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
}

.level-item:nth-child(9) .level-icon {
    background: linear-gradient(135deg, #14b8a6 0%, #10b981 100%);
}

.level-item:nth-child(10) .level-icon {
    background: linear-gradient(135deg, #f43f5e 0%, #ef4444 100%);
}

.level-item:nth-child(11) .level-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #22c55e 100%);
}

.level-item:nth-child(12) .level-icon {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
}

.level-item:nth-child(13) .level-icon {
    background: linear-gradient(135deg, #fb7185 0%, #f97316 100%);
}

.level-item:nth-child(14) .level-icon {
    background: linear-gradient(135deg, #22c55e 0%, #84cc16 100%);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.35);
}

.level-item:nth-child(15) .level-icon {
    background: linear-gradient(135deg, #f97316 0%, #facc15 100%);
}

.level-item:nth-child(16) .level-icon {
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
}

.level-item:nth-child(17) .level-icon {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}

.level-item:nth-child(18) .level-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #4f46e5 100%);
}

.level-item:nth-child(19) .level-icon {
    background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
}

.level-item:nth-child(20) .level-icon {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.level-item:nth-child(21) .level-icon {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
}

/* ========== Footer ========== */
.footer {
    background: #ffffff;
    color: var(--text-color);
    padding: 0.85rem 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    border-top: 1px solid var(--border-color);
}

.footer-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-left p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-right a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.88rem;
    opacity: 0.9;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.footer-right a:hover {
    opacity: 1;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.footer-right a i {
    font-size: 0.85rem;
    color: var(--primary-color);
}

/* ========== Animations ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.level-item {
    animation: fadeInUp 0.6s ease-out backwards;
}

.level-item:nth-child(1) { animation-delay: 0.05s; }
.level-item:nth-child(2) { animation-delay: 0.1s; }
.level-item:nth-child(3) { animation-delay: 0.15s; }
.level-item:nth-child(4) { animation-delay: 0.2s; }
.level-item:nth-child(5) { animation-delay: 0.25s; }
.level-item:nth-child(6) { animation-delay: 0.3s; }
.level-item:nth-child(7) { animation-delay: 0.35s; }
.level-item:nth-child(8) { animation-delay: 0.4s; }
.level-item:nth-child(9) { animation-delay: 0.45s; }
.level-item:nth-child(10) { animation-delay: 0.5s; }
.level-item:nth-child(11) { animation-delay: 0.55s; }
.level-item:nth-child(12) { animation-delay: 0.6s; }
.level-item:nth-child(13) { animation-delay: 0.65s; }
.level-item:nth-child(14) { animation-delay: 0.7s; }
.level-item:nth-child(15) { animation-delay: 0.75s; }
.level-item:nth-child(16) { animation-delay: 0.8s; }
.level-item:nth-child(17) { animation-delay: 0.85s; }
.level-item:nth-child(18) { animation-delay: 0.9s; }
.level-item:nth-child(19) { animation-delay: 0.95s; }
.level-item:nth-child(20) { animation-delay: 1s; }
.level-item:nth-child(21) { animation-delay: 1.05s; }

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Active Effects */
.level-item:active {
    transform: scale(0.95);
}

.nav-btn:active,
.search-btn:active {
    transform: scale(0.95);
}

/* Focus Styles */
.search-box:focus,
.nav-btn:focus,
.search-btn:focus {
    outline: none;
    outline-offset: 0;
}

