/* =========================================================
   BATTA BHAT PARA SC HIGH SCHOOL
   MODERN PUBLIC / USER PANEL UI
   Works with the provided index.html and app.js
   ========================================================= */

/* ---------- 1. Design tokens ---------- */

:root {
    --primary: #b91c1c;
    --primary-dark: #991b1b;
    --primary-deep: #7f1d1d;
    --primary-light: #fff1f2;
    --primary-soft: #ffe4e6;

    --secondary: #1e3a8a;
    --text: #182230;
    --muted: #667085;
    --subtle: #98a2b3;

    --background: #f7f8fc;
    --surface: #ffffff;
    --surface-soft: #fffafa;

    --border: #e8eaf0;
    --border-strong: #d7dce5;

    --success: #15803d;
    --warning: #b45309;
    --danger: #b91c1c;

    --shadow-sm: 0 3px 12px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 12px 32px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 22px 55px rgba(127, 29, 29, 0.14);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 30px;

    --container: 1160px;
}


/* ---------- 2. Reset ---------- */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 95px;
}

body {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--background);
    color: var(--text);
    font-family: "Noto Sans Bengali", "Hind Siliguri", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

body.viewer-open {
    overflow: hidden;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(185, 28, 28, 0.35);
    outline-offset: 3px;
}

::selection {
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.container {
    width: min(var(--container), 92%);
    margin-inline: auto;
}


/* ---------- 3. Loading screen ---------- */

.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 35%, #fff1f2 0, transparent 42%),
        #ffffff;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.loader.hidden {
    display: none !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

.loader-logo,
.brand-logo {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: linear-gradient(145deg, #dc2626, #991b1b);
    color: #ffffff;
    font-weight: 900;
    letter-spacing: -1px;
    box-shadow: 0 8px 22px rgba(185, 28, 28, 0.22);
}

.loader-logo {
    width: 74px;
    height: 74px;
    border-radius: 23px;
    font-size: 27px;
    animation: loader-pulse 1.5s ease-in-out infinite;
}

.loader-content p {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

@keyframes loader-pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}


/* ---------- 4. Navigation bar ---------- */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(232, 234, 240, 0.9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: box-shadow 0.25s ease, background 0.25s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 28px rgba(16, 24, 40, 0.08);
}

.nav-container {
    position: relative;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    font-size: 19px;
}

.brand-text {
    min-width: 0;
}

.brand-text h2 {
    color: var(--primary-deep);
    font-size: 17px;
    font-weight: 900;
    line-height: 1.4;
}

.brand-text p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 11px;
    border-radius: 11px;
    color: #475467;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(185, 28, 28, 0.2);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #ffffff;
}

.menu-toggle span {
    width: 19px;
    height: 2px;
    border-radius: 4px;
    background: var(--primary);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.active span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:last-child {
    transform: translateY(-7px) rotate(-45deg);
}


/* ---------- 5. Hero section ---------- */

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 82px 0 88px;
    background:
        radial-gradient(ellipse at 85% 18%, rgba(255, 255, 255, 0.13), transparent 30%),
        linear-gradient(125deg, #7f1d1d 0%, #b91c1c 54%, #dc2626 100%);
    color: #ffffff;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 95%, rgba(255, 255, 255, 0.08), transparent 26%),
        radial-gradient(circle at 95% 70%, rgba(127, 29, 29, 0.28), transparent 32%);
}

.hero::before,
.hero::after {
    position: absolute;
    z-index: -1;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    pointer-events: none;
}

.hero::before {
    width: 430px;
    height: 430px;
    top: -230px;
    right: -90px;
}

.hero::after {
    width: 270px;
    height: 270px;
    bottom: -180px;
    left: 38%;
}

.hero-container {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
    align-items: center;
    gap: 54px;
}

.hero-content {
    max-width: 680px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 22px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.11);
    color: #fff7f7;
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fecaca;
    box-shadow: 0 0 0 4px rgba(254, 202, 202, 0.13);
}

.hero h1 {
    max-width: 720px;
    margin-bottom: 22px;
    font-size: clamp(34px, 5vw, 58px);
    font-weight: 900;
    line-height: 1.28;
    letter-spacing: -1.4px;
}

.hero h1 span {
    display: block;
    color: #fecaca;
}

.hero-description {
    max-width: 620px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.87);
    font-size: 16px;
    line-height: 1.95;
}

.hero-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.btn span {
    font-size: 20px;
    line-height: 1;
}

.btn-primary {
    background: #ffffff;
    color: var(--primary-deep);
    box-shadow: 0 8px 20px rgba(72, 9, 9, 0.16);
}

.btn-primary:hover {
    transform: translateY(-3px);
    background: #fff7f7;
    box-shadow: 0 12px 26px rgba(72, 9, 9, 0.22);
}

.btn-outline {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.btn-outline:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.16);
}

.hero-visual {
    position: relative;
    min-width: 0;
    padding: 18px;
}

.hero-image-frame {
    position: relative;
    min-height: 330px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 34px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.07));
    box-shadow: 0 24px 60px rgba(73, 10, 10, 0.2);
    backdrop-filter: blur(10px);
}

.hero-image-placeholder {
    width: 100%;
    min-height: 330px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 30px;
    text-align: center;
}

.placeholder-icon {
    display: grid;
    place-items: center;
    width: 100px;
    height: 100px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 50px;
}

.hero-image-placeholder p {
    margin-bottom: 5px;
    font-size: 21px;
    font-weight: 900;
}

.hero-image-placeholder span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.floating-card {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
    padding: 14px 17px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    animation: floating-card 4s ease-in-out infinite;
}

.floating-card-top {
    top: 2px;
    left: -5px;
}

.floating-card-bottom {
    right: -5px;
    bottom: 4px;
    animation-delay: -2s;
}

.floating-icon {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    border-radius: 13px;
    background: var(--primary-light);
    font-size: 22px;
}

.floating-card strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.floating-card p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

@keyframes floating-card {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

.hero-bottom-decoration {
    position: absolute;
    right: -5%;
    bottom: -85px;
    left: -5%;
    height: 120px;
    border-radius: 50% 50% 0 0;
    background: var(--background);
}


/* ---------- 6. Section defaults ---------- */

.section {
    position: relative;
    padding: 82px 0;
}

.section-heading {
    max-width: 760px;
    margin: 0 auto 42px;
    text-align: center;
}

.section-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding: 6px 13px;
    border: 1px solid #fecdd3;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.section-heading h2 {
    margin-bottom: 12px;
    color: var(--text);
    font-size: clamp(27px, 4vw, 39px);
    font-weight: 900;
    line-height: 1.35;
    letter-spacing: -0.6px;
}

.section-heading h2 span {
    color: var(--primary);
}

.section-heading > p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
}

.section-footer {
    margin-top: 24px;
    text-align: center;
}


/* ---------- 7. Statistics ---------- */

.stats-section {
    position: relative;
    z-index: 3;
    padding: 22px 0 30px;
    background: var(--background);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.stat-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 17px;
    min-width: 0;
    padding: 23px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.stat-card::after {
    position: absolute;
    top: -35px;
    right: -35px;
    width: 95px;
    height: 95px;
    border-radius: 50%;
    background: var(--primary-light);
    content: "";
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 17px;
    background: var(--primary-light);
    font-size: 27px;
}

.stat-info {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.stat-info > p {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stat-info h2 {
    margin-bottom: 2px;
    color: var(--primary);
    font-size: clamp(20px, 2.6vw, 29px);
    font-weight: 900;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.stat-description {
    display: block;
    color: var(--subtle);
    font-size: 11px;
}

.loading-text {
    color: var(--muted);
    font-size: 15px;
}


/* ---------- 8. About section ---------- */

.about-section {
    background: var(--surface);
}

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: center;
    gap: 64px;
}

.about-visual {
    position: relative;
    min-height: 350px;
}

.about-image-placeholder {
    position: relative;
    z-index: 1;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #fecdd3;
    border-radius: 30px;
    background:
        radial-gradient(circle at 25% 20%, #ffffff 0, transparent 30%),
        linear-gradient(145deg, #fff1f2, #ffe4e6);
    color: var(--primary-deep);
    text-align: center;
}

.about-image-placeholder span {
    display: grid;
    place-items: center;
    width: 110px;
    height: 110px;
    margin-bottom: 18px;
    border-radius: 32px;
    background: #ffffff;
    box-shadow: var(--shadow-md);
    font-size: 55px;
}

.about-image-placeholder p {
    font-size: 16px;
    font-weight: 800;
}

.about-decoration {
    position: absolute;
    right: -17px;
    bottom: -17px;
    width: 55%;
    height: 55%;
    border: 3px solid #fecaca;
    border-radius: 30px;
}

.about-content h3 {
    margin-bottom: 17px;
    color: var(--text);
    font-size: clamp(22px, 3vw, 29px);
    font-weight: 900;
    line-height: 1.5;
}

.about-content > p {
    margin-bottom: 15px;
    color: #596579;
    font-size: 15px;
    line-height: 2;
}

.about-features {
    display: grid;
    gap: 12px;
    margin: 24px 0 28px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 11px;
}

.feature-item span {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #dcfce7;
    color: var(--success);
    font-size: 14px;
    font-weight: 900;
}

.feature-item p {
    color: #475467;
    font-size: 14px;
    font-weight: 700;
}

.about-content .btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.about-content .btn-primary:hover {
    background: var(--primary-dark);
}


/* ---------- 9. Teachers ---------- */

.teachers-section {
    background: var(--background);
}

.teachers-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 23px;
}

.teacher-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.teacher-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.teacher-image {
    width: 100%;
    height: 270px;
    object-fit: cover;
    object-position: center top;
    background: linear-gradient(145deg, #fff1f2, #f1f5f9);
}

.teacher-image-placeholder {
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 20px;
    font-weight: 900;
}

.teacher-card-content {
    padding: 22px;
}

.teacher-name {
    margin-bottom: 6px;
    color: var(--text);
    font-size: 19px;
    font-weight: 900;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.teacher-designation {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.info-label {
    color: #475467;
    font-weight: 800;
}

.info-value {
    color: var(--muted);
}


/* ---------- 10. Notices ---------- */

.notices-section {
    background: var(--surface);
}

.notice-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 18px;
}

.notice-card {
    position: relative;
    min-width: 0;
    padding: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 19px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.notice-card::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--primary);
    content: "";
}

.notice-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.notice-title {
    margin-bottom: 12px;
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.notice-date {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.notice-content {
    color: #596579;
    font-size: 14px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}


/* ---------- 11. Class routines ---------- */

.routines-section {
    background: var(--background);
}

.routine-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 20px;
}

.routine-card {
    min-width: 0;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.routine-title {
    margin-bottom: 16px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--border);
    color: var(--primary-deep);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.5;
}

.routine-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
}

.routine-table {
    width: 100%;
    min-width: 430px;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 12px;
    text-align: left;
}

.routine-table th {
    padding: 12px 11px;
    background: var(--primary-light);
    color: var(--primary-deep);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.routine-table td {
    padding: 12px 11px;
    border-top: 1px solid var(--border);
    color: #475467;
    vertical-align: top;
}

.routine-table tbody tr:nth-child(even) {
    background: #fffafa;
}

.routine-table tbody tr:hover {
    background: #fff1f2;
}

.routine-empty {
    padding: 14px;
    border-radius: 10px;
    background: var(--background);
    color: var(--muted);
    font-size: 13px;
}


/* ---------- 12. Exam schedules ---------- */

.exams-section {
    background: var(--surface);
}

.exam-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 18px;
}

.exam-card {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.exam-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.exam-title {
    margin-bottom: 15px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--border);
    color: var(--primary);
    font-size: 19px;
    font-weight: 900;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.exam-details {
    display: grid;
    gap: 8px;
}

.exam-details .info-row {
    display: grid;
    grid-template-columns: 75px minmax(0, 1fr);
    gap: 8px;
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

.exam-details .info-label {
    color: #475467;
}

.exam-details .info-value {
    color: var(--text);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.exam-instructions {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
    line-height: 1.8;
}


/* ---------- 13. Gallery ---------- */

.gallery-section {
    background: var(--background);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
}

.gallery-card {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 19px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-align: left;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.gallery-image {
    width: 100%;
    height: 245px;
    object-fit: cover;
    background: linear-gradient(145deg, #fff1f2, #f1f5f9);
    transition: transform 0.35s ease;
}

.gallery-card:hover .gallery-image {
    transform: scale(1.035);
}

.gallery-title {
    display: block;
    padding: 15px 17px;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    overflow-wrap: anywhere;
}


/* ---------- 14. Contact ---------- */

.contact-section {
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 228, 230, 0.7), transparent 30%),
        var(--surface);
}

.contact-card {
    max-width: 700px;
    margin-inline: auto;
    padding: 35px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.contact-icon {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    border-radius: 21px;
    background: var(--primary-light);
    font-size: 30px;
}

.contact-card h3 {
    margin-bottom: 12px;
    color: var(--text);
    font-size: 23px;
    font-weight: 900;
}

.contact-card p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.contact-card .contact-address {
    max-width: 520px;
    margin: 12px auto;
    line-height: 1.9;
}

.contact-email a {
    color: var(--primary);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.contact-email a:hover {
    text-decoration: underline;
}


/* ---------- 15. Footer ---------- */

.footer {
    padding: 48px 0 20px;
    background: #171923;
    color: #e5e7eb;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 25px;
    padding-bottom: 30px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.footer-logo {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.footer-brand h3 {
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
}

.footer-brand p {
    color: #cbd5e1;
    font-size: 12px;
}

.footer-description {
    max-width: 420px;
    color: #aeb6c5;
    font-size: 13px;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-bottom p {
    color: #aeb6c5;
    font-size: 12px;
}

.back-to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    transition: background 0.2s ease;
}

.back-to-top:hover {
    background: rgba(255, 255, 255, 0.1);
}


/* ---------- 16. Loading / empty / error messages ---------- */

.section-loading,
.empty-message {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    min-height: 145px;
    padding: 24px;
    border: 1px dashed var(--border-strong);
    border-radius: 18px;
    background: var(--surface);
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

.loading-spinner {
    width: 35px;
    height: 35px;
    border: 3px solid var(--primary-soft);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#teachersStatus,
#galleryStatus {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.empty-message {
    margin: 0;
    color: var(--muted);
}

.error,
.status-error {
    color: var(--danger);
}

.success,
.status-success {
    color: var(--success);
}


/* ---------- 17. Image viewer ---------- */

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    padding: 65px 20px 25px;
    background: rgba(12, 15, 22, 0.94);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.image-viewer.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#viewerImage {
    max-width: min(100%, 1100px);
    max-height: 78vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

#viewerCaption {
    max-width: 800px;
    color: #ffffff;
    text-align: center;
    font-size: 14px;
}

.viewer-close {
    position: absolute;
    top: 18px;
    right: 20px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 30px;
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}

.viewer-close:hover {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.22);
}


/* ---------- 18. Reveal animation ---------- */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ---------- 19. Tablet ---------- */

@media (max-width: 1050px) {
    .nav-container {
        gap: 14px;
    }

    .brand-text h2 {
        font-size: 15px;
    }

    .nav-link {
        padding: 8px 9px;
        font-size: 12px;
    }

    .hero-container {
        gap: 30px;
    }

    .about-grid {
        gap: 40px;
    }

    .teacher-image {
        height: 235px;
    }
}


/* ---------- 20. Mobile navigation and layout ---------- */

@media (max-width: 780px) {
    html {
        scroll-padding-top: 75px;
    }

    .nav-container {
        min-height: 72px;
    }

    .brand-logo {
        width: 44px;
        height: 44px;
        border-radius: 14px;
        font-size: 17px;
    }

    .brand-text h2 {
        font-size: 14px;
    }

    .brand-text p {
        font-size: 11px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: calc(100% + 1px);
        right: 0;
        left: 0;
        display: none;
        align-items: stretch;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 5px;
        max-height: calc(100vh - 75px);
        overflow-y: auto;
        padding: 13px;
        border: 1px solid var(--border);
        border-top: 0;
        border-radius: 0 0 18px 18px;
        background: #ffffff;
        box-shadow: var(--shadow-md);
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-link {
        justify-content: flex-start;
        min-height: 43px;
        padding: 10px 13px;
        font-size: 14px;
    }

    .hero {
        padding: 60px 0 80px;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero h1 {
        font-size: clamp(32px, 8vw, 48px);
    }

    .hero-visual {
        width: min(100%, 520px);
        margin-inline: auto;
    }

    .hero-image-frame,
    .hero-image-placeholder {
        min-height: 290px;
    }

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

    .stat-card {
        padding: 19px;
    }

    .stat-info h2 {
        font-size: 25px;
    }

    .section {
        padding: 62px 0;
    }

    .section-heading {
        margin-bottom: 30px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .about-visual,
    .about-image-placeholder {
        min-height: 290px;
    }

    .teachers-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }

    .notice-list,
    .routine-list,
    .exam-list {
        grid-template-columns: 1fr;
    }

    .teacher-image {
        height: 230px;
    }

    .teacher-card-content {
        padding: 17px;
    }

    .teacher-name {
        font-size: 17px;
    }

    .gallery-image {
        height: 210px;
    }

    .contact-card {
        padding: 28px 22px;
    }

    .footer-content {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* ---------- 21. Small mobile ---------- */

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .container {
        width: 91%;
    }

    .hero {
        padding: 46px 0 70px;
    }

    .hero-badge {
        margin-bottom: 17px;
        font-size: 11px;
    }

    .hero h1 {
        margin-bottom: 17px;
        font-size: 32px;
        letter-spacing: -0.6px;
    }

    .hero-description {
        margin-bottom: 23px;
        font-size: 14px;
        line-height: 1.9;
    }

    .hero-buttons {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .hero-visual {
        padding: 10px;
    }

    .hero-image-frame,
    .hero-image-placeholder {
        min-height: 245px;
    }

    .placeholder-icon {
        width: 75px;
        height: 75px;
        border-radius: 23px;
        font-size: 38px;
    }

    .hero-image-placeholder p {
        font-size: 18px;
    }

    .floating-card {
        min-width: 0;
        max-width: 205px;
        padding: 10px 12px;
        gap: 9px;
    }

    .floating-card-top {
        left: -5px;
    }

    .floating-card-bottom {
        right: -5px;
    }

    .floating-icon {
        width: 35px;
        height: 35px;
        border-radius: 11px;
        font-size: 18px;
    }

    .floating-card strong {
        font-size: 11px;
    }

    .floating-card p {
        font-size: 10px;
    }

    .section {
        padding: 50px 0;
    }

    .section-heading h2 {
        font-size: 27px;
    }

    .section-heading > p {
        font-size: 13px;
    }

    .stats-section {
        padding-top: 15px;
    }

    .stat-card {
        gap: 13px;
        padding: 16px;
        border-radius: 16px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 23px;
    }

    .stat-info h2 {
        font-size: 22px;
    }

    .about-visual,
    .about-image-placeholder {
        min-height: 245px;
    }

    .about-image-placeholder span {
        width: 85px;
        height: 85px;
        border-radius: 25px;
        font-size: 43px;
    }

    .about-content h3 {
        font-size: 22px;
    }

    .teachers-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .teacher-image {
        height: 270px;
    }

    .gallery-image {
        height: 230px;
    }

    .notice-card,
    .routine-card,
    .exam-card {
        padding: 18px;
        border-radius: 16px;
    }

    .notice-title,
    .routine-title,
    .exam-title {
        font-size: 17px;
    }

    .contact-card {
        padding: 25px 17px;
        border-radius: 19px;
    }

    .contact-card h3 {
        font-size: 21px;
    }

    .footer {
        padding-top: 35px;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* ---------- 22. Very small phones ---------- */

@media (max-width: 350px) {
    .brand {
        gap: 8px;
    }

    .brand-logo {
        width: 39px;
        height: 39px;
        font-size: 15px;
    }

    .brand-text h2 {
        font-size: 12px;
    }

    .brand-text p {
        font-size: 10px;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
    }

    .hero h1 {
        font-size: 29px;
    }

    .floating-card {
        max-width: 175px;
    }

    .section-heading h2 {
        font-size: 24px;
    }
}


/* ---------- 23. Reduced motion accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}