﻿/* =========================================================
   OPTIMIZED BASE.CSS WITH HEADER STYLES INTEGRATED
   ========================================================= */

/* ================= CSS CUSTOM PROPERTIES ================= */
:root {
    /* Colors */
    --text: #333;
    --text-light: #666;
    --white: #fff;
    --gray: #f5f5f5;
    --gray-light: #f8f9fa;
    --gray-dark: #6c757d;
    --border: #dee2e6;
    /* Theme Colors */
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #0dcaf0;
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 350ms ease;
    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-tooltip: 1060;
}

/* ================= RESET & BASE STYLES ================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    font: inherit;
}

/* ================= LAYOUT UTILITIES ================= */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.full-width {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* ================= TYPOGRAPHY ================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

    a:hover {
        text-decoration: underline;
    }

/* ================= TOP BAR ================= */
.top-bar {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    font-size: 0.875rem;
    z-index: var(--z-fixed);
}

.header-social-links {
    display: flex;
    gap: var(--space-sm);
}

.social-link {
    color: var(--white);
    opacity: 0.8;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

    .social-link:hover {
        opacity: 1;
        transform: translateY(-2px);
        text-decoration: none;
    }

/* ================= HEADER STYLES ================= */
.school-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: var(--space-md) 0;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: var(--z-sticky);
}

.header-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

/* Header Brand (Logo + School Name) */
.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    min-width: 300px;
}

.school-logo {
    height: 80px;
    width: 80px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 3px solid rgba(255, 255, 255, 0.2);
    background: var(--white);
    padding: 5px;
}

.header-brand-text {
    flex: 1;
}

.school-name {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    margin-bottom: var(--space-xs);
    color: var(--white);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.school-affiliation,
.school-established {
    font-size: 0.875rem;
    opacity: 0.9;
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

.affiliation-label,
.established-label {
    font-weight: 600;
}

/* Header Contact Information */
.header-contact {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-width: 250px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
}

    .contact-item i {
        width: 20px;
        text-align: center;
        color: rgba(255, 255, 255, 0.8);
    }

.contact-text {
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.3;
}

/* ================= HEADER STYLE VARIANTS ================= */

/* Classic Header (Default) */
.header-classic .header-content {
    flex-direction: row;
    align-items: center;
}

.header-classic .header-contact {
    text-align: right;
}

/* Modern Header */
.header-modern .header-content {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
}

.header-modern .header-brand {
    flex-direction: column;
    text-align: center;
    min-width: auto;
}

.header-modern .school-logo {
    height: 100px;
    width: 100px;
}

.header-modern .header-contact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Compact Header */
.header-compact {
    padding: var(--space-sm) 0;
}

    .header-compact .school-logo {
        height: 50px;
        width: 50px;
    }

    .header-compact .school-name {
        font-size: clamp(1.2rem, 2vw, 1.5rem);
    }

    .header-compact .contact-item {
        font-size: 0.8rem;
    }

/* Split Header */
.header-split .header-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.header-split .header-brand {
    min-width: auto;
}

.header-split .header-contact {
    text-align: right;
    align-items: flex-end;
}

/* Stacked Header */
.header-stacked .header-content {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
}

.header-stacked .header-brand {
    flex-direction: column;
    text-align: center;
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.header-stacked .header-contact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    text-align: center;
}

/* ================= SCROLL MESSAGE ================= */
.scroll-message-bar {
    background: var(--scroll-bg, linear-gradient(90deg, var(--primary), var(--success)));
    color: var(--scroll-color, var(--white));
    padding: var(--space-sm) 0;
    overflow: hidden;
    position: relative;
    z-index: var(--z-fixed);
    font-weight: 500;
}

.scroll-wrapper {
    display: flex;
    width: max-content;
    animation: scrollHorizontal var(--scroll-speed, 30s) linear infinite;
}

.scroll-message-bar:hover .scroll-wrapper {
    animation-play-state: paused;
}

@keyframes scrollHorizontal {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Scroll Style Variants */
.scroll-style-highlight {
    --scroll-bg: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    --scroll-color: #fff;
}

.scroll-style-subtle {
    --scroll-bg: #f8f9fa;
    --scroll-color: #495057;
    border-bottom: 1px solid #dee2e6;
}

.scroll-style-dark {
    --scroll-bg: #343a40;
    --scroll-color: #fff;
}

.scroll-style-gradient {
    --scroll-bg: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    --scroll-color: #fff;
}

/* ================= NAVIGATION ================= */
.navbar-custom {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    transition: all var(--transition);
}

    .navbar-custom.scrolled {
        box-shadow: var(--shadow-lg);
    }

    .navbar-custom .nav-link {
        font-weight: 600;
        padding: var(--space-sm) var(--space-md);
        transition: all var(--transition-fast);
        position: relative;
    }

        .navbar-custom .nav-link.active {
            color: var(--primary);
        }

            .navbar-custom .nav-link.active::after {
                content: '';
                position: absolute;
                bottom: 0;
                left: var(--space-md);
                right: var(--space-md);
                height: 3px;
                background: var(--primary);
                border-radius: var(--radius-sm) var(--radius-sm) 0 0;
            }

/* ================= HERO SLIDER ================= */
.hero-slider {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.hero-img {
    width: 100%;
    height: clamp(400px, 70vh, 600px);
    object-fit: cover;
    object-position: center;
}

.carousel-caption {
    position: absolute;
    bottom: 15%;
    left: 10%;
    right: 10%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    color: var(--white);
    max-width: 600px;
}

    .carousel-caption h1 {
        font-size: clamp(1.75rem, 5vw, 3rem);
        margin-bottom: var(--space-sm);
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    }

    .carousel-caption p {
        font-size: clamp(1rem, 2vw, 1.25rem);
        opacity: 0.9;
    }

/* Slider layout variants */
.slider-full .hero-slider {
    border-radius: 0;
}

.slider-center .hero-slider {
    margin: var(--space-xl) auto;
    max-width: 90%;
}

/* Split layout */
.hero-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: center;
}

    .hero-split .hero-slider {
        height: 100%;
    }

    .hero-split .hero-img {
        height: 400px;
        min-height: auto;
    }

/* ================= CONTENT CARDS ================= */
.content-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

    .content-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--card-accent, linear-gradient(90deg, var(--primary), var(--accent)));
    }

    .content-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-md);
    position: relative;
    padding-bottom: var(--space-sm);
}

    .card-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 60px;
        height: 3px;
        background: var(--primary);
    }

/* ================= NOTICES & EVENTS ================= */
.notice-item,
.event-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
    transition: all var(--transition-fast);
}

    .notice-item:hover,
    .event-item:hover {
        background: var(--gray-light);
        padding-left: var(--space-lg);
    }

.notice-date,
.event-date {
    background: var(--primary);
    color: var(--white);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    min-width: 70px;
}

/* ================= VERTICAL MARQUEE ================= */
.marquee-container {
    position: relative;
    height: 350px; /* keep in sync with card body */
    overflow: hidden;
    /* Smooth fade top & bottom */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
}

/* Moving content */
.marquee-content {
    will-change: transform;
    animation: marquee-vertical 30s linear infinite;
}

/* Pause on hover */
.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

/* Vertical loop animation */
@keyframes marquee-vertical {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-50%);
    }
}

/* ================= AUTHORITIES ================= */
.authority-card {
    position: relative;
    border-radius: 50%;
    width: 150px;
    height: 150px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
}

    .authority-card:hover {
        transform: scale(1.05);
        box-shadow: var(--shadow-lg);
    }

    .authority-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform var(--transition-slow);
    }

    .authority-card:hover img {
        transform: scale(1.1);
    }

.authority-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-md);
    opacity: 0;
    transition: opacity var(--transition);
}

.authority-card:hover .authority-overlay {
    opacity: 1;
}

/* ================= GALLERY ================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/9;
}

    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform var(--transition-slow);
    }

    .gallery-item:hover img {
        transform: scale(1.1);
    }

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    color: var(--white);
    display: flex;
    align-items: flex-end;
    padding: var(--space-md);
    opacity: 0;
    transition: opacity var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* ================= QUICK STATS ================= */
.quick-stats-section {
    background: var(--gray-light);
    position: relative;
    overflow: hidden;
}

    .quick-stats-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--primary), var(--accent));
    }

    .quick-stats-section .content-card {
        border: none;
        box-shadow: var(--shadow-sm);
        text-align: center;
        padding: var(--space-lg);
    }

        .quick-stats-section .content-card i {
            font-size: 2.5rem;
            color: var(--primary);
            margin-bottom: var(--space-sm);
        }

    .quick-stats-section h3 {
        font-size: 2rem;
        font-weight: 700;
        color: var(--text);
        margin-bottom: var(--space-xs);
    }

/* ================= FOOTER ================= */
.footer {
    background: var(--footer-bg, linear-gradient(135deg, var(--dark) 0%, #000 100%));
    color: var(--white);
    padding: var(--space-xl) 0 var(--space-md);
    position: relative;
}

    .footer::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--primary), var(--accent));
    }

.footer-heading {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    position: relative;
    padding-bottom: var(--space-sm);
}

    .footer-heading::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 40px;
        height: 2px;
        background: var(--accent);
    }

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    display: block;
    padding: var(--space-xs) 0;
    transition: all var(--transition-fast);
}

    .footer-link:hover {
        color: var(--white);
        padding-left: var(--space-sm);
        text-decoration: none;
    }

.footer-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transition: all var(--transition);
    margin-right: var(--space-sm);
}

    .footer-social-icon:hover {
        background: var(--accent);
        transform: translateY(-2px);
        color: var(--white);
    }

/* ================= ADMISSION BANNER ================= */
.admission-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
}

    .admission-banner::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--success), var(--warning));
    }

/* ================= SCROLLABLE CONTENT ================= */
.scrollable-content {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    max-height: 400px;
    overflow-y: auto;
    padding-right: var(--space-sm);
}

    .scrollable-content::-webkit-scrollbar {
        width: 6px;
    }

    .scrollable-content::-webkit-scrollbar-track {
        background: transparent;
        border-radius: var(--radius-sm);
    }

    .scrollable-content::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: var(--radius-sm);
    }

        .scrollable-content::-webkit-scrollbar-thumb:hover {
            background: var(--gray-dark);
        }

/* ================= BUTTONS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

    .btn-primary:hover {
        background: var(--primary-dark);
        border-color: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        text-decoration: none;
    }

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

    .btn-outline-primary:hover {
        background: var(--primary);
        color: var(--white);
        transform: translateY(-2px);
    }

.btn-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

    .btn-success:hover {
        background: #157347;
        border-color: #146c43;
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

/* ================= UTILITIES ================= */
.scroll-to-top {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: var(--z-tooltip);
    box-shadow: var(--shadow-lg);
    border: none;
}

    .scroll-to-top.visible {
        opacity: 1;
        visibility: visible;
    }

    .scroll-to-top:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
    }

/* ================= ANIMATIONS ================= */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }

    .hero-split {
        grid-template-columns: 1fr;
    }

    .carousel-caption {
        left: 5%;
        right: 5%;
        bottom: 10%;
    }

    .hero-img {
        height: clamp(350px, 60vh, 500px);
    }

    /* Header responsive styles */
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-brand {
        flex-direction: column;
        text-align: center;
        min-width: auto;
    }

    .header-contact {
        align-items: center;
    }

    .header-split .header-content {
        grid-template-columns: 1fr;
    }

    .header-split .header-contact {
        text-align: center;
        align-items: center;
    }
}

@media (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 var(--space-sm);
    }

    .school-header {
        padding: var(--space-sm) 0;
    }

    .school-logo {
        height: 60px;
        width: 60px;
    }

    .navbar-custom .nav-link {
        padding: var(--space-sm);
    }

    .carousel-caption {
        position: static;
        background: rgba(0, 0, 0, 0.8);
        margin: 0;
        border-radius: 0;
        padding: var(--space-md);
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .marquee-container {
        height: 300px;
    }

    .footer {
        text-align: center;
    }

    .footer-heading::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .scroll-to-top {
        bottom: var(--space-md);
        right: var(--space-md);
    }

    /* Header mobile styles */
    .header-contact {
        font-size: 0.8rem;
    }

    .contact-item {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 575px) {
    :root {
        --space-lg: 1rem;
        --space-xl: 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.125rem;
    }

    .content-card {
        padding: var(--space-md);
    }

    .btn {
        padding: var(--space-sm) var(--space-md);
        width: 100%;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* ================= PRINT STYLES ================= */
@media print {
    .navbar-custom,
    .footer,
    .scroll-message-bar,
    .scroll-to-top,
    .btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    a {
        text-decoration: underline;
        color: #000;
    }
}
