:root {
    --primary-blue: #003366;
    --secondary-blue: #004d99;
    --accent-yellow: #ffcc00;
    --text-dark: #333333;
    --text-light: #ffffff;
    --bg-light: #f4f4f4;
    --bg-white: #ffffff;
    --border-color: #dddddd;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

/* Header & Navigation */
header {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
}

.top-header {
    background-color: var(--primary-blue);
    color: var(--text-light);
    padding: 10px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.school-info h1 {
    font-size: 1.8rem;
    color: var(--accent-yellow);
    margin: 0;
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.school-info p {
    font-size: 0.8rem;
    font-style: italic;
}

.contact-top {
    display: flex;
    gap: 20px;
}

.nav-bar {
    background-color: var(--secondary-blue);
    padding: 0 5%;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li a {
    color: var(--text-light);
    text-decoration: none;
    padding: 15px 20px;
    display: block;
    font-weight: 500;
    transition: background var(--transition-speed);
}

.nav-links li a:hover,
.nav-links li a.active {
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
}

/* Footer */
footer {
    background-color: var(--primary-blue);
    color: var(--text-light);
    padding: 40px 5% 20px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--accent-yellow);
    display: inline-block;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer-section ul li a:hover {
    color: var(--accent-yellow);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    font-size: 0.8rem;
}

/* Utility Classes */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: transform var(--transition-speed), background var(--transition-speed);
    cursor: pointer;
}

.btn-yellow {
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
}

.btn-yellow:hover {
    transform: translateY(-3px);
    background-color: #e6b800;
}

.btn-blue {
    background-color: var(--primary-blue);
    color: var(--text-light);
}

.btn-blue:hover {
    transform: translateY(-3px);
    background-color: var(--secondary-blue);
}

/* Main Content Layout Adjustments */
main {
    margin-top: 130px;
    /* Space for the absolute header strips */
}

/* On home page, we want the hero at the top, so we remove the margin */
body.home-page main {
    margin-top: 0;
}

.section-padding {
    padding: 40px 5%;
}

.text-center {
    text-align: center;
}

.section-title {
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--accent-yellow);
}

/* Hero Section */
.hero {
    height: 600px;
    background-size: cover;
    background-position: top;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    padding-top: 80px;
    /* Shift content slightly downwards */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 30px 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px -12px rgba(0, 0, 0, 0.5);
}

.hero-sub {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 5px;
    color: var(--accent-yellow) !important;
    font-weight: 600;
}

.hero-title {
    font-size: 3rem !important;
    margin-bottom: 10px !important;
    font-family: 'Cinzel', serif !important;
    font-weight: 800 !important;
    background: linear-gradient(to bottom, #ffffff, #cccccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none !important;
}

.hero-tagline {
    font-size: 1.3rem !important;
    margin-bottom: 20px !important;
    font-weight: 300 !important;
    opacity: 0.9;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.btn-outline {
    border: 2px solid var(--text-light);
    color: var(--text-light);
    background: transparent;
}

.btn-outline:hover {
    background: var(--text-light);
    color: var(--primary-blue);
    transform: translateY(-3px);
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 1.2s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0px rgba(255, 204, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 204, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0px rgba(255, 204, 0, 0);
    }
}

/* Notice Board */
.notice-board {
    background-color: var(--primary-blue);
    color: var(--text-light);
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 50px;
    border-bottom: 3px solid var(--accent-yellow);
}

.notice-title {
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
    padding: 0 30px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1.1rem;
    white-space: nowrap;
    position: relative;
    z-index: 10;
}

.notice-title::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 0;
    border-left: 20px solid var(--accent-yellow);
    border-top: 25px solid transparent;
    border-bottom: 25px solid transparent;
}

.notice-ticker {
    flex-grow: 1;
    overflow: hidden;
}

.notice-ticker marquee {
    height: 100%;
    display: flex;
    align-items: center;
    padding-top: 13px;
    /* Center text visually */
}

.notice-ticker span {
    margin-right: 50px;
    font-size: 1rem;
    font-weight: 500;
}

/* About Section */
.about-school {
    display: flex;
    gap: 50px;
    align-items: center;
}

.about-image img {
    width: 100%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.about-content h2 {
    color: var(--primary-blue);
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.about-content h4 {
    color: var(--secondary-blue);
    margin-bottom: 15px;
}

/* Academics Section */
.streams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stream-card {
    background: var(--bg-light);
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    transition: transform var(--transition-speed), background var(--transition-speed);
}

.stream-card:hover {
    transform: translateY(-5px);
    background: var(--secondary-blue);
    color: var(--text-light);
}

.stream-card i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary-blue);
}

.stream-card:hover i {
    color: var(--accent-yellow);
}

/* Facilities & Gallery Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    height: 200px;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.card:hover img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--primary-blue);
    color: var(--text-light);
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

/* Responsive Layout Updates */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.5rem !important;
    }

    .about-school {
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        padding: 15px 5%;
        text-align: center;
        gap: 15px;
    }

    .logo-section {
        flex-direction: column;
        justify-content: center;
        gap: 10px;
    }

    .contact-top {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }

    .nav-bar {
        justify-content: space-between;
        align-items: center;
        padding: 10px 5%;
        position: relative;
    }

    .nav-links {
        display: none;
        /* Hide by default on mobile */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--secondary-blue);
        z-index: 999;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li a {
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center;
    }

    .menu-toggle {
        display: block;
        color: var(--text-light);
        font-size: 1.5rem;
        cursor: pointer;
    }

    .hero {
        height: 500px;
        padding-top: 60px;
    }

    .hero-content {
        padding: 20px;
        margin: 0 15px;
    }

    .hero-title {
        font-size: 2rem !important;
    }

    .hero-tagline {
        font-size: 1.1rem !important;
    }

    .notice-board {
        flex-direction: column;
        height: auto;
    }

    .notice-title {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }

    .notice-title::after {
        display: none;
    }

    .notice-ticker {
        width: 100%;
        height: 40px;
        /* Fixed height for ticker on mobile */
    }

    .about-school {
        flex-direction: column;
        text-align: center;
    }

    .about-image img {
        max-width: 100%;
    }

    .about-content h2 {
        font-size: 2rem;
    }

    .principal-message {
        flex-direction: column;
        text-align: center;
        padding: 20px !important;
    }

    .principal-img {
        flex: 0 0 auto !important;
        margin-bottom: 20px;
    }

    .section-padding {
        padding: 30px 3%;
    }

    /* Change header to relative on mobile to avoid overlapping */
    header {
        position: relative;
    }

    main {
        margin-top: 0 !important;
    }

    body.home-page main {
        margin-top: 0 !important;
    }

    .hero {
        padding-top: 20px;
        /* Reduce padding since header is no longer absolute */
        height: auto;
        min-height: 400px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem !important;
    }

    .hero-btns {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .school-info h1 {
        font-size: 1.4rem;
    }
}

/* Ensure menu-toggle is hidden on larger screens */
.menu-toggle {
    display: none;
}

/* Section improvements for scaling */
.section-title {
    font-size: 2rem;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 1.6rem;
    }
}

/* Photo Gallery Ticker */
.ticker-container {
    width: 100%;
    overflow: hidden;
    padding: 30px 0;
    position: relative;
    background: var(--bg-light);
}

.ticker-wrapper {
    display: flex;
    white-space: nowrap;
    width: max-content;
    animation: scroll-ticker 35s linear infinite;
}

.ticker-item {
    flex: 0 0 320px;
    height: 220px;
    margin: 0 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.ticker-item:hover {
    transform: scale(1.05);
    z-index: 2;
}

.ticker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes scroll-ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-350px * 9));
    }
}

.ticker-container:hover .ticker-wrapper {
    animation-play-state: paused;
}

@media (max-width: 768px) {
    .ticker-item {
        flex: 0 0 250px;
        height: 180px;
    }

    @keyframes scroll-ticker {
        0% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(calc(-280px * 9));
        }
    }
}

/* Gallery Page Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.gallery-item {
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

/* Lightbox Modal Styles */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    /* Increased z-index to be above header */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 40px;
    box-sizing: border-box;
}

.lightbox-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: var(--accent-yellow);
}

.gallery-item,
.ticker-item {
    cursor: pointer;
}