/* =========================================================
   ABC HIGH SCHOOL - MAIN STYLESHEET
   Sections: Reset, Variables, Header/Nav, Buttons, Hero,
   Cards, Sections, Forms, Tables, Footer, Utilities, Media Queries
   ========================================================= */

/* ---------- Universal / Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* box model */
}

/* ---------- CSS Variables (Theme) ---------- */
:root {
    --dark-blue: #0d2a5a;
    --royal-blue: #1e4fbf;
    --gold: #f5b400;
    --white: #ffffff;
    --light-gray: #f2f4f8;
    --mid-gray: #d8dce4;
    --text-dark: #1b1f27;
    --text-muted: #5a6270;
    --bg-body: var(--light-gray);
    --bg-card: var(--white);
    --shadow: 0 4px 14px rgba(13, 42, 90, 0.12);
    --radius: 10px;
    --transition: all 0.3s ease;
}

/* Dark theme overrides */
body.dark-theme {
    --bg-body: #101521;
    --bg-card: #1a2033;
    --text-dark: #eef1f8;
    --text-muted: #b7bccb;
    --light-gray: #161c2c;
    --mid-gray: #2a3145;
}

/* ---------- Base Element Selectors ---------- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", Verdana, Arial, Helvetica, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
}

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

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

ul, ol {
    list-style-position: inside;
}

h1, h2, h3, h4 {
    color: var(--dark-blue);
    line-height: 1.3;
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4 {
    color: var(--gold);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Focus effect - accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* ---------- Top Info Bar ---------- */
.top-bar {
    background-color: var(--dark-blue);
    color: var(--white);
    font-size: 0.85rem;
    padding: 6px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.top-bar .greeting {
    color: var(--gold);
    font-weight: 600;
}

/* ---------- Header ---------- */
.site-header {
    background-color: var(--white);
    box-shadow: var(--shadow);
}

body.dark-theme .site-header {
    background-color: var(--bg-card);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}

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

.brand img.logo {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 2px solid var(--gold);
}

.brand-text h1 {
    font-size: 1.4rem;
}

.brand-text .tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ---------- Navigation (Sticky) ---------- */
.main-nav {
    background-color: var(--dark-blue);
    position: sticky; /* sticky positioning */
    top: 0;
    z-index: 999; /* z-index usage */
    width: 100%;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li a {
    display: inline-block; /* inline-block usage */
    color: var(--white);
    padding: 16px 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.nav-links li a:hover,
.nav-links li a.active {
    background-color: var(--royal-blue);
    border-bottom: 3px solid var(--gold);
    color: var(--gold);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.7rem;
    cursor: pointer;
    padding: 10px 20px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--gold);
    color: var(--dark-blue);
}

.btn-primary:hover {
    background-color: #ffca33;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--dark-blue);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--royal-blue);
    color: var(--royal-blue);
}

.btn-outline:hover {
    background-color: var(--royal-blue);
    color: var(--white);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-danger {
    background-color: #d9534f;
    color: var(--white);
}

.btn-danger:hover {
    background-color: #b52b27;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ---------- Hero Slider ---------- */
.hero-slider {
    position: relative; /* relative positioning for absolute children */
    width: 100%;
    height: 520px;
    overflow: hidden; /* overflow usage */
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active-slide {
    opacity: 1;
    z-index: 2;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13,42,90,0.35), rgba(13,42,90,0.75));
}

.hero-text {
    position: absolute; /* absolute positioning */
    bottom: 12%;
    left: 8%;
    max-width: 600px;
    color: var(--white);
    z-index: 3;
}

.hero-text h2 {
    color: var(--white);
    font-size: 2.4rem;
    margin-bottom: 12px;
}

.hero-text p {
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.hero-buttons .btn {
    margin-right: 12px;
    margin-bottom: 10px;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.85);
    color: var(--dark-blue);
    border: none;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    transition: var(--transition);
}

.slider-btn:hover {
    background-color: var(--gold);
}

.prev-btn { left: 18px; }
.next-btn { right: 18px; }

.slider-dots {
    position: absolute;
    bottom: 18px;
    right: 5%;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.6);
    cursor: pointer;
}

.dot.active-dot {
    background-color: var(--gold);
}

/* ---------- Sections General ---------- */
.section {
    padding: 60px 0;
}

.section-alt {
    background-color: var(--bg-card);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 8px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* ---------- Welcome Section ---------- */
.welcome-box {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

#dynamicSchoolName {
    color: var(--royal-blue);
}

body.dark-theme #dynamicSchoolName {
    color: var(--gold);
}

.welcome-input-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.welcome-input-row input {
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--mid-gray);
    min-width: 260px;
}

/* ---------- Principal Message ---------- */
.principal-article {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.principal-article img {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--gold);
    box-shadow: var(--shadow);
}

.principal-article .msg-text {
    flex: 1;
    min-width: 280px;
}

.signature {
    margin-top: 16px;
    font-style: italic;
    font-weight: 600;
    color: var(--royal-blue);
}

/* ---------- Statistics Cards ---------- */
.stats-grid {
    display: grid; /* grid display */
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    padding: 30px 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-6px);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--royal-blue);
}

body.dark-theme .stat-number {
    color: var(--gold);
}

.stat-label {
    color: var(--text-muted);
    margin-top: 6px;
}

/* ---------- Clubs Section ---------- */
.club-manager {
    max-width: 700px;
    margin: 0 auto;
}

.club-add-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.club-add-row input {
    flex: 1;
    min-width: 220px;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--mid-gray);
}

#clubError {
    color: #d9534f;
    font-size: 0.9rem;
    margin-bottom: 12px;
    min-height: 20px;
}

.club-list {
    list-style: none;
}

.club-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
}

.club-list li span {
    font-weight: 600;
}

/* ---------- Quote Section ---------- */
.quote-box {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    background: linear-gradient(135deg, var(--dark-blue), var(--royal-blue));
    color: var(--white);
    padding: 40px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.quote-box p {
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 20px;
}

/* ---------- Theme Controls ---------- */
.theme-controls {
    text-align: center;
}

.theme-controls .btn {
    margin: 6px;
}

.color-swatches {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.swatch {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--white);
    box-shadow: var(--shadow);
}

/* ---------- Facility / Feature Cards ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 22px rgba(13,42,90,0.22);
}

.feature-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.feature-card-body {
    padding: 18px;
}

.feature-card-body h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.feature-card-body p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* ---------- Page Banner (inner pages) ---------- */
.page-banner {
    position: relative;
    background-size: cover;
    background-position: center;
    color: var(--white);
    text-align: center;
    padding: 90px 20px;
}

.page-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(13, 42, 90, 0.7);
}

.page-banner-content {
    position: relative;
    z-index: 2;
}

.page-banner h1 {
    color: var(--white);
    font-size: 2.4rem;
}

.breadcrumb {
    margin-top: 10px;
    font-size: 0.95rem;
}

.breadcrumb a {
    color: var(--gold);
}

.breadcrumb span {
    margin: 0 6px;
}

/* ---------- Vision / Mission ---------- */
.vision-card {
    background: linear-gradient(135deg, var(--royal-blue), var(--dark-blue));
    color: var(--white);
    padding: 34px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.vision-card h2 { color: var(--white); }

.mission-list li,
.objectives-list li {
    margin-bottom: 10px;
    padding-left: 6px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* ---------- Forms ---------- */
.form-wrapper {
    max-width: 850px;
    margin: 0 auto;
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

fieldset {
    border: 1px solid var(--mid-gray);
    border-radius: 8px;
    margin-bottom: 26px;
    padding: 20px;
}

legend {
    padding: 0 10px;
    font-weight: 700;
    color: var(--royal-blue);
}

body.dark-theme legend { color: var(--gold); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.92rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 11px 14px;
    border-radius: 6px;
    border: 1px solid var(--mid-gray);
    background-color: var(--bg-body);
    color: var(--text-dark);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--royal-blue);
    box-shadow: 0 0 0 3px rgba(30, 79, 191, 0.18);
    outline: none;
}

.radio-group,
.checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.radio-group label,
.checkbox-group label {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.error-text {
    color: #d9534f;
    font-size: 0.82rem;
    margin-top: 4px;
    min-height: 16px;
}

.success-box {
    background-color: #e6f6ec;
    border: 1px solid #34a853;
    color: #1e7a3c;
    padding: 18px;
    border-radius: 8px;
    margin-top: 20px;
}

body.dark-theme .success-box {
    background-color: #163524;
    color: #7be0a2;
}

.summary-box {
    background-color: var(--light-gray);
    border-left: 4px solid var(--royal-blue);
    padding: 18px;
    margin-top: 16px;
    border-radius: 6px;
}

.age-result,
.name-processed {
    margin-top: 8px;
    font-weight: 600;
    color: var(--royal-blue);
}

body.dark-theme .age-result,
body.dark-theme .name-processed {
    color: var(--gold);
}

.form-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* ---------- Table ---------- */
.table-wrapper {
    overflow-x: auto; /* responsive horizontal scroll */
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    background-color: var(--bg-card);
}

table caption {
    padding: 14px;
    font-weight: 700;
    text-align: left;
    color: var(--royal-blue);
}

thead {
    background-color: var(--dark-blue);
    color: var(--white);
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border: 1px solid var(--mid-gray);
}

tbody tr:nth-child(even) {
    background-color: var(--light-gray);
}

tbody tr:hover {
    background-color: #dbe6ff;
    cursor: pointer;
}

body.dark-theme tbody tr:hover {
    background-color: #26314f;
}

.teacher-photo-cell img {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
}

#hoverMessage {
    text-align: center;
    margin-top: 20px;
    font-weight: 600;
    color: var(--royal-blue);
    min-height: 26px;
}

body.dark-theme #hoverMessage { color: var(--gold); }

/* ---------- Teacher Cards ---------- */
.teacher-card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    padding: 26px 18px;
    transition: var(--transition);
}

.teacher-card:hover {
    transform: translateY(-6px);
}

.teacher-card img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 14px;
    border: 3px solid var(--gold);
}

.teacher-card h3 {
    font-size: 1.05rem;
}

.teacher-card .dept {
    color: var(--royal-blue);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

body.dark-theme .teacher-card .dept { color: var(--gold); }

.teacher-card p.profile {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* ---------- Contact Page ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info-list {
    list-style: none;
}

.contact-info-list li {
    margin-bottom: 16px;
    padding: 14px 18px;
    background-color: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.contact-info-list li strong {
    display: block;
    color: var(--royal-blue);
    margin-bottom: 4px;
}

body.dark-theme .contact-info-list li strong { color: var(--gold); }

.map-frame {
    width: 100%;
    height: 300px;
    border: 3px solid var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 20px;
}

.social-icons {
    display: flex;
    gap: 14px;
    margin-top: 20px;
}

.social-icons a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--dark-blue);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--gold);
    color: var(--dark-blue);
    transform: translateY(-4px);
}

/* ---------- Footer ---------- */
.site-footer {
    background-color: var(--dark-blue);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-grid h3 {
    color: var(--gold);
    margin-bottom: 14px;
    font-size: 1.05rem;
}

.footer-grid p, .footer-grid a {
    color: #cdd6ea;
    font-size: 0.9rem;
}

.footer-links li {
    list-style: none;
    margin-bottom: 8px;
}

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

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 16px;
    font-size: 0.85rem;
    color: #b7c1da;
}

/* ---------- Scroll To Top ---------- */
#scrollTopBtn {
    position: fixed; /* fixed positioning */
    bottom: 30px;
    right: 30px;
    background-color: var(--gold);
    color: var(--dark-blue);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: none;
    z-index: 500;
    transition: var(--transition);
}

#scrollTopBtn:hover {
    background-color: var(--dark-blue);
    color: var(--gold);
}

#scrollTopBtn.show-btn {
    display: block;
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }
.external-link-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ---------- Responsive Media Queries ---------- */

/* Tablet */
@media (max-width: 992px) {
    .stats-grid,
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .two-col,
    .contact-grid {
        grid-template-columns: 1fr;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--dark-blue);
    }

    .nav-links.show-menu {
        display: flex;
    }

    .nav-links li a {
        display: block;
        padding: 14px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .hero-slider {
        height: 420px;
    }

    .hero-text {
        left: 5%;
        right: 5%;
        max-width: 90%;
    }

    .hero-text h2 {
        font-size: 1.6rem;
    }

    .principal-article {
        flex-direction: column;
        text-align: center;
    }

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

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }

    table {
        min-width: 700px;
    }
}

@media (max-width: 480px) {
    .brand-text h1 {
        font-size: 1.1rem;
    }

    .hero-text h2 {
        font-size: 1.3rem;
    }

    .slider-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .form-wrapper {
        padding: 22px;
    }
}
