@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #0c6230;
    --primary-light: #127b3e;
    --primary-dark: #074521;
    --accent: #d4af37;
    --accent-light: #e6c25c;
    --accent-dark: #aa8924;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-light: #9ca3af;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --bg-dark: #111827;
    --border: #e5e7eb;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 20px -2px rgba(12, 98, 48, 0.08), 0 4px 6px -1px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 30px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
    
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    font-weight: 700;
    line-height: 1.2;
}

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

a:hover {
    color: var(--accent-dark);
}

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

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
    font-size: 2.25rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--accent);
    margin: 0.75rem auto 0;
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font-heading);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background-color: var(--accent);
    color: var(--text-primary);
}

.btn-accent:hover {
    background-color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Header & Navigation */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.top-bar {
    background-color: var(--primary-dark);
    color: var(--bg-white);
    padding: 0.5rem 0;
    font-size: 0.85rem;
}

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

.top-bar-links a {
    color: var(--bg-white);
    margin-left: 1.5rem;
}

.top-bar-links a:hover {
    color: var(--accent);
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    color: var(--primary);
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.85rem; /* Reduced to fit on one line */
    align-items: center;
    flex-wrap: nowrap; /* Prevent wrapping onto second line */
}

.nav-item {
    position: relative;
    flex-shrink: 0;
}

.nav-link {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 0.92rem; /* Adjusted slightly to fit */
    padding: 0.5rem 0.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
}

/* Responsive adjustment for tighter screens (laptops) */
@media (max-width: 1200px) and (min-width: 992px) {
    .nav-menu {
        gap: 0.5rem;
    }
    .nav-link {
        font-size: 0.82rem;
    }
    .logo-container {
        gap: 0.5rem;
    }
    .logo-text h1 {
        font-size: 0.95rem;
    }
}

.nav-link:hover, .nav-item.active .nav-link {
    color: var(--primary);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    list-style: none;
    min-width: 220px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    border-top: 3px solid var(--primary);
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item a {
    display: block;
    padding: 0.6rem 1.25rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.dropdown-item a:hover {
    background-color: var(--bg-light);
    color: var(--primary);
    padding-left: 1.5rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary);
}

@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 110px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 110px);
        background-color: var(--bg-white);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        gap: 1rem;
        transition: 0.4s ease;
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        border-top: none;
        border-left: 2px solid var(--primary);
        margin-left: 1rem;
        display: none;
        padding: 0;
    }
    
    .nav-item.open .dropdown-menu {
        display: block;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
}

/* Hero Slideshow / Carousel */
.hero-slider {
    position: relative;
    height: 480px;
    background-color: var(--bg-dark);
    overflow: hidden;
}

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

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

.slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(7, 69, 33, 0.8) 30%, rgba(0,0,0,0.3) 100%);
    z-index: 2;
}

.slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.slide-content {
    position: relative;
    z-index: 5;
    color: var(--bg-white);
    max-width: 650px;
    padding-left: 2rem;
}

.slide-content h2 {
    font-size: 3rem;
    color: var(--bg-white);
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease forwards;
}

.slide-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    font-size: 1.25rem;
    transition: var(--transition);
}

.slider-btn:hover {
    background: var(--primary);
    color: var(--bg-white);
}

.slider-btn-prev { left: 1.5rem; }
.slider-btn-next { right: 1.5rem; }

.slider-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 0.5rem;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.slider-dot.active {
    background: var(--accent);
    width: 28px;
    border-radius: 6px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hero-slider { height: 360px; }
    .slide-content h2 { font-size: 2rem; }
    .slide-content p { font-size: 1rem; }
    .slider-btn { display: none; }
}

/* News ticker / Announcements */
.news-ticker-section {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
}

.news-ticker-wrapper {
    display: flex;
    align-items: stretch;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-light);
    border: 1px solid var(--border);
}

.ticker-title {
    background-color: #c82345;
    color: var(--bg-white);
    padding: 1rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border-right: 1px solid var(--border);
}

.ticker-content {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    height: 168px; /* 3 items visible * 56px slot size */
    padding: 6px 1rem;
}

.ticker-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.ticker-item a {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.ticker-list {
    list-style: none;
    position: absolute;
    top: 6px;
    left: 1rem;
    width: calc(100% - 2rem);
    margin: 0;
    padding: 0;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ticker-item {
    height: 50px;
    margin-bottom: 6px;
    padding: 0 1rem;
    background-color: var(--bg-white);
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.ticker-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.ticker-item {
    padding: 0 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

@keyframes tickerLoop {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

/* Cards & Grid sections */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(12, 98, 48, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.5rem;
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.35rem;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Welcome split block */
.welcome-grid {
    align-items: center;
}

.welcome-img-wrapper {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.welcome-img-wrapper::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    pointer-events: none;
}

/* Leadership Desk Cards */
.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.member-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
}

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

.member-img-wrapper {
    height: 250px;
    overflow: hidden;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.member-card:hover .member-img {
    transform: scale(1.05);
}

.member-info {
    padding: 1.5rem;
}

.member-name {
    font-size: 1.15rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.member-role {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

/* Stats section */
.stats-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--bg-white);
    text-align: center;
}

.stats-grid {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-item h3 {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.stat-item p {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
}

/* Footer styling */
.main-footer {
    background-color: var(--bg-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 4rem 0 0;
    font-size: 0.9rem;
    border-top: 5px solid var(--accent);
}

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

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-col h4 {
    color: var(--bg-white);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo-img {
    width: 50px;
}

.footer-logo h3 {
    color: var(--bg-white);
    font-size: 1.15rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 0.5rem;
}

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

.contact-info-list li {
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.75rem;
}

.bottom-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
    font-size: 0.8rem;
}

/* Subpage Layout with Tabs */
.subpage-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--bg-white);
    padding: 4rem 0;
    text-align: center;
}

.subpage-banner h2 {
    color: var(--bg-white);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subpage-banner p {
    color: var(--accent);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.tab-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

@media (min-width: 992px) {
    .tab-container {
        grid-template-columns: 280px 1fr;
    }
}

.tab-menu {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border);
    height: fit-content;
}

.tab-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-left: 4px solid transparent;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    background-color: var(--bg-light);
    color: var(--primary);
}

.tab-btn.active {
    background-color: rgba(12, 98, 48, 0.05);
    color: var(--primary);
    border-left-color: var(--primary);
}

.tab-content {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 3rem;
    border: 1px solid var(--border);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-pane h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.75rem;
}

.tab-pane p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Tables in Academics/Uniform */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.table th, .table td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

.table th {
    background-color: var(--primary);
    color: var(--bg-white);
    font-family: var(--font-heading);
    font-weight: 600;
}

.table tr:nth-child(even) {
    background-color: var(--bg-light);
}

/* School Song Tamil Styling */
.tamil-lyrics {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 2;
    color: var(--primary-dark);
    text-align: center;
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    margin: 1.5rem 0;
}

/* Gallery & Albums */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.album-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.album-cover-wrapper {
    height: 180px;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-dark);
}

.album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.album-card:hover .album-cover {
    transform: scale(1.05);
}

.album-info {
    padding: 1.25rem;
}

.album-title {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
    font-family: var(--font-heading);
}

.album-count {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: var(--bg-white);
    font-size: 2rem;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: var(--bg-white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.lightbox-nav:hover {
    background: var(--primary);
}

.lightbox-prev { left: -70px; }
.lightbox-next { right: -70px; }

@media (max-width: 768px) {
    .lightbox-nav { display: none; }
}

/* Contact page details & form */
.contact-grid {
    align-items: stretch;
}

.contact-form-wrapper {
    background-color: var(--bg-white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(12, 98, 48, 0.1);
}

.map-wrapper {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    height: 100%;
    min-height: 450px;
}

.map-wrapper iframe {
    width: 100%;
    height: 100%;
    min-height: 450px;
    border: none;
}
