/* ========================================
   CSS RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #002b54;
    --secondary-color: #e67e22;
    --secondary-hover: #cf711f;
    --text-color: #333;
    --text-light: #555;
    --bg-light: #f1f4f8;
    --bg-dark: #002b54;
    --white: #fff;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 35px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8f9fa;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color var(--transition);
}
a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
}

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

/* ========================================
   UTILITY CLASSES
   ======================================== */
.section-title {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 15px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}
.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 3rem;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    transition: all var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
}
.btn-primary {
    background-color: var(--secondary-color);
    color: var(--white);
}
.btn-primary:hover {
    background-color: var(--secondary-hover);
    transform: scale(1.02);
    color: var(--white);
}
.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}
.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
}
.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.card {
    background: var(--white);
    padding: 30px 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid #eee;
    text-align: center;
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}
.card i {
    font-size: 2.8rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}
.card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.text-left {
    text-align: left;
}
.text-left ul {
    list-style: none;
    padding: 0;
}
.text-left ul li {
    padding: 6px 0;
    border-bottom: 1px dashed #eee;
}
.text-left ul li i {
    font-size: 0.9rem;
    margin-right: 10px;
    color: var(--secondary-color);
    margin-bottom: 0;
}

.bg-light {
    background-color: var(--bg-light);
}
.bg-dark {
    background-color: var(--bg-dark);
    color: var(--white);
}
.bg-dark .section-title {
    color: var(--white);
}
.bg-dark .section-title::after {
    background: var(--secondary-color);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 1.1rem;
}
.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    flex-wrap: wrap;
}
.logo h1 {
    font-size: 1.6rem;
    color: var(--primary-color);
}
.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}
.logo span {
    color: var(--secondary-color);
}

nav {
    display: flex;
    align-items: center;
}
nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
nav ul li a {
    position: relative;
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 3px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}
nav ul li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 100%;
    height: 2px;
    background: var(--secondary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}
nav ul li a:hover,
nav ul li a.active {
    border-bottom-color: var(--secondary-color);
    color: var(--primary-color);
}
nav ul li a:hover::after,
nav ul li a.active::after {
    transform: scaleX(1);
}

.hamburger {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary-color);
    background: none;
    border: none;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    background: linear-gradient(rgba(0, 43, 84, 0.85), rgba(0, 43, 84, 0.75)),
        url('https://images.unsplash.com/photo-1580582932707-520aed937b7b?ixlib=rb-4.0.3&auto=format&fit=crop&w=1632&q=80') no-repeat center center/cover;
    color: var(--white);
    padding: 100px 0;
    text-align: center;
}
.hero-content h1 {
    font-size: 3.2rem;
    margin-bottom: 20px;
    line-height: 1.2;
}
.hero-content p {
    font-size: 1.3rem;
    max-width: 750px;
    margin: 0 auto 35px;
    opacity: 0.9;
}
.hero-buttons .btn {
    margin: 0 10px 10px 0;
}

/* ========================================
   WELCOME SECTION
   ======================================== */
.welcome {
    padding: 80px 0;
}
.welcome-text {
    text-align: center;
    max-width: 850px;
    margin: 0 auto;
}
.welcome-text h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}
.welcome-text p {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 20px;
}

/* ========================================
   HIGHLIGHTS SECTION
   ======================================== */
.highlights {
    padding: 60px 0;
}

/* ========================================
   ABOUT SECTION
   ======================================== */
.about {
    padding: 80px 0;
}
.about-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}
.about-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 6px solid var(--secondary-color);
}
.about-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}
.values-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}
.values-list li {
    background: var(--bg-light);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.95rem;
}

blockquote {
    background: var(--bg-light);
    padding: 20px 30px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    margin: 10px 0;
}
blockquote p {
    margin-bottom: 10px;
}
blockquote footer {
    margin-top: 15px;
    font-style: normal;
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}
.staff-item {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #eee;
    transition: transform var(--transition);
}
.staff-item:hover {
    transform: scale(1.02);
}
.staff-item h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}
.staff-item p {
    font-size: 0.9rem;
    color: var(--text-light);
}
.staff-item .staff-position {
    color: var(--secondary-color);
    font-weight: 500;
}

/* ========================================
   ACADEMICS SECTION
   ======================================== */
.academics {
    padding: 80px 0;
}
.dept-list {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}
.dept-list li {
    padding: 5px 0;
    border-bottom: 1px dashed #ddd;
}
.dept-list li i {
    color: var(--secondary-color);
    margin-right: 10px;
    font-size: 0.6rem;
}

.academics-performance {
    text-align: center;
    margin-top: 50px;
    padding: 40px 30px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.academics-performance h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
}
.academics-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   SCHOOL LIFE SECTION
   ======================================== */
.school-life {
    padding: 80px 0;
}
.life-card ul li i {
    font-size: 0.9rem;
    margin-right: 10px;
    color: var(--secondary-color);
    margin-bottom: 0;
}

/* ========================================
   NEWS SECTION
   ======================================== */
.news {
    padding: 80px 0;
}
.news-item {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border-bottom: 4px solid var(--secondary-color);
    transition: transform var(--transition);
}
.news-item:hover {
    transform: translateY(-4px);
}
.news-item .date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
    display: block;
}
.news-item h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}
.news-item p {
    color: var(--text-light);
}

/* ========================================
   ADMISSION SECTION
   ======================================== */
.admission {
    padding: 80px 0;
}
.benefits-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}
.benefits-list li {
    margin-bottom: 15px;
    padding: 12px 18px;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}
.benefits-list li i {
    color: var(--secondary-color);
    margin-right: 12px;
}

.admission-step {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
}
.step-number {
    background: var(--secondary-color);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}
.admission-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* ========================================
   GALLERY SECTION
   ======================================== */
.gallery {
    padding: 80px 0;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.gallery-item {
    border-radius: 10px;
    overflow: hidden;
    background: #e9ecef;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
    position: relative;
    opacity: 0;
    left: -45px;
}
.gallery-item.is-visible {
    animation: gallery-slide-in 0.65s ease forwards;
    animation-delay: var(--gallery-delay, 0s);
}
.gallery-item.is-visible:hover,
.gallery-item.is-visible:focus-visible {
    animation: none;
    opacity: 1;
    transform: scale(1.03);
    box-shadow: var(--shadow-hover);
    outline: 3px solid rgba(230, 126, 34, 0.35);
    outline-offset: 3px;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-placeholder {
    position: relative;
    font-size: 2rem;
    color: #888;
    font-weight: 500;
    text-align: center;
    padding: 20px;
}
.gallery-placeholder::after {
    content: '';
    display: block;
    width: 42px;
    height: 3px;
    margin: 14px auto 0;
    background: var(--secondary-color);
    transform: scaleX(0.45);
    transition: transform var(--transition);
}
.gallery-item:hover .gallery-placeholder::after {
    transform: scaleX(1);
}
@keyframes gallery-slide-in {
    from {
        opacity: 0;
        left: -45px;
    }
    to {
        opacity: 1;
        left: 0;
    }
}

/* ========================================
   LIBRARY SECTION
   ======================================== */
.library {
    padding: 80px 0;
}
.library-rules {
    margin-top: 20px;
    padding: 15px 20px;
    background: var(--bg-light);
    border-radius: 8px;
}

/* ========================================
   PORTALS SECTION
   ======================================== */
.portals {
    padding: 80px 0;
}
.portal-card {
    background: var(--white);
    padding: 35px 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform var(--transition);
    color: var(--text-color);
}
.portal-card:hover {
    transform: scale(1.03);
}
.portal-card i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}
.portal-card h3 {
    color: var(--primary-color);
}
.portal-card p {
    color: var(--text-light);
    margin: 15px 0 20px;
}
.portal-btn {
    margin-top: 10px;
}

/* ========================================
   CONTACT SECTION
   ======================================== */
.contact {
    padding: 80px 0;
}
.contact-info p {
    margin-bottom: 12px;
    font-size: 1.05rem;
}
.contact-info i {
    color: var(--secondary-color);
    margin-right: 12px;
    width: 25px;
}

.social-links {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.social-links .btn {
    padding: 10px 20px;
}

.contact-form .form-group {
    margin-bottom: 15px;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition);
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}
.contact-form textarea {
    height: 150px;
    resize: vertical;
}
.contact-form button {
    width: 100%;
    padding: 14px;
}
.form-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    display: none;
}
.form-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.form-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    background: #001a33;
    color: #ccc;
    padding: 50px 0 20px;
}
footer h4 {
    color: var(--white);
    margin-bottom: 20px;
}
footer ul {
    list-style: none;
    padding: 0;
}
footer ul li {
    margin-bottom: 10px;
}
footer ul li a {
    color: #bbb;
    transition: color var(--transition);
}
footer ul li a:hover {
    color: var(--secondary-color);
}
footer ul li i {
    margin-right: 10px;
    color: var(--secondary-color);
    width: 20px;
}
.footer-tagline {
    font-size: 0.9rem;
    opacity: 0.8;
}
.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 25px;
    margin-top: 30px;
    text-align: center;
    font-size: 0.9rem;
}
.developer-credit {
    margin-top: 8px;
    color: var(--white);
    font-weight: 600;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .header-container {
        flex-direction: row;
    }
    nav ul {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--white);
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        margin-top: 15px;
        gap: 0;
    }
    nav ul.open {
        display: flex;
    }
    nav ul.open li {
        animation: menu-slide-in 0.4s ease both;
    }
    nav ul.open li:nth-child(2) { animation-delay: 0.04s; }
    nav ul.open li:nth-child(3) { animation-delay: 0.08s; }
    nav ul.open li:nth-child(4) { animation-delay: 0.12s; }
    nav ul.open li:nth-child(5) { animation-delay: 0.16s; }
    nav ul.open li:nth-child(6) { animation-delay: 0.20s; }
    nav ul.open li:nth-child(7) { animation-delay: 0.24s; }
    nav ul.open li:nth-child(8) { animation-delay: 0.28s; }
    nav ul.open li:nth-child(9) { animation-delay: 0.32s; }
    nav ul.open li:nth-child(10) { animation-delay: 0.36s; }
    nav ul li {
        text-align: center;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    nav ul li:last-child {
        border-bottom: none;
    }

    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    .about-content {
        gap: 20px;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .staff-grid {
        grid-template-columns: 1fr 1fr;
    }
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
    .logo h1 {
        font-size: 1.2rem;
    }
    .logo img {
        width: 44px;
        height: 44px;
    }
    .admission-actions,
    .academics-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .social-links .btn {
        flex: 1;
        text-align: center;
    }
}

@keyframes menu-slide-in {
    from {
        opacity: 0;
        transform: translateX(-18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@media (max-width: 480px) {
    .hero {
        padding: 60px 0;
    }
    .staff-grid {
        grid-template-columns: 1fr;
    }
    .values-list li {
        width: 100%;
    }
}