/* =========================================
   BASE STYLES & TYPOGRAPHY
========================================= */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
}

/* =========================================
   HEADER & LOGOS
========================================= */
.top-header {
    border-bottom: 2px solid #eaeaea;
    background: #ffffff;
}

.main-logo {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 14px;
}

.school-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
}

.school-name-main {
    font-family: 'Cinzel', serif;
    color: #1a528f;
    font-weight: 700;
    font-size: 2.55rem;
    letter-spacing: 1px;
    line-height: 0.9;
    margin: 0;
}

.school-sub-main {
    font-family: 'Poppins', sans-serif;
    color: #1a528f;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 2px;
    line-height: 1;
    margin-top: 6px;
    margin-left: 2px;
}

/* Mobile Header Adjustments */
@media (max-width: 576px) {
    .main-logo {
        width: 55px;
        height: 55px;
    }

    .school-text{
        display:flex;
        flex-direction:column;
        justify-content:center;
        align-items:flex-start;
        line-height:1;
    }

    .school-name-main {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }

    .school-sub-main {
        font-size: 0.6rem;
        letter-spacing: 1px;
    }
}

/* =========================================
   NEWS MARQUEE
========================================= */
.top-news-container { display: flex; align-items: center; background: #1a528f; border: 1px solid #1a528f; border-radius: 5px; overflow: hidden; }
.news-label { background: #1a528f; color: white; padding: 6px 15px; font-weight: bold; font-size: 0.85rem; white-space: nowrap; }
marquee { background: #ffffff; padding: 5px; font-weight: 500; color: #1a528f; margin: 0; flex: 1; }

/* =========================================
   NAVIGATION
========================================= */
.navbar { background-color: #1a528f; padding: 0; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.navbar .nav-link { color: #ffffff; font-weight: 500; padding: 15px 20px !important; transition: background 0.3s; }
.navbar .nav-link:hover, .navbar .nav-link.active { background-color: #123c69; color: #2fa184 !important; }

/* Mobile Navigation Adjustments */
@media (max-width: 991px) {
    .navbar-nav { display: flex; flex-direction: column; align-items: center; }
    .navbar-toggler { margin-right: auto !important; margin-left: 0 !important; }
}

/* =========================================
   GENERAL LAYOUTS & CARDS
========================================= */
.section-title {
    font-family: 'Cinzel', serif;
    color: #1a528f;
    font-weight: bold;
    border-bottom: 3px solid #2fa184;
    display: inline-block;
    padding-bottom: 5px;
}

/* Setup all cards to have transitions */
.facility-card,
.faculty-card,
.about-card,
.vision-mission-card {
    background: white;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

/* Facility Cards */
.facility-card {
    border-top: 5px solid #1a528f;
    min-height: 340px;          /* Same height for all boxes */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.facility-card h5 {
    min-height: 60px;           /* Keeps titles aligned */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 15px;
}

.facility-card p {
    flex-grow: 1;
    text-align: center;
    margin-bottom: 0;
}

/* Shared push-up hover effect */
.facility-card:hover,
.faculty-card:hover,
.vision-mission-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.facility-icon {
    font-size: 2.5rem;
    color: #1a528f;
    margin-bottom: 15px;
}

/* Faculty Images */
.faculty-img { width: 100%; height: 250px; object-fit: cover; margin: 0; border: none; background-color: #f8f9fa; }


/* =========================================
   ADMISSION FORM CUSTOM COLORS
========================================= */
/* Update form headings to footer blue */
.form-section-title {
    color: #1a528f;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #1a528f;
    padding-bottom: 5px;
}
/* Update submit button to footer blue */
.custom-submit-btn {
    background-color: #1a528f !important;
    border-color: #1a528f !important;
    color: #ffffff !important;
}
/* Add a hover effect for the submit button matching the navbar hover style */
.custom-submit-btn:hover {
    background-color: #123c69 !important; 
    border-color: #123c69 !important;
    color: #2fa184 !important; 
}

/* ============================
   Admission Cards Hover Effect
============================= */

.admission-card{
    transition: all 0.35s ease;
    cursor: default;
}

.admission-card:hover{
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 18px 35px rgba(0,0,0,.18) !important;
}

/* =========================================
   INDEX PAGE SPECIFICS
========================================= */
/* Carousel Uniform Height Fix */
/* Hero Banner */
#schoolCarousel .carousel-item {
    background: #fff;
    text-align: center;
}

#schoolCarousel .carousel-item img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    object-position: center;
    display: block;
    margin: 0 auto;
}

@media (max-width: 768px) {
    #schoolCarousel .carousel-item img {
        max-height: 300px;
    }
}

#schoolCarousel .carousel-item img { width: 100%; height: auto; object-fit: contain; display:block;margin:auto; }
@media (max-width: 768px) { #schoolCarousel .carousel-item img { height: 200px; } }

.news-sidebar { background-color: #1a528f; color: white; border-radius: 15px 15px 0 0; }
.news-sidebar h3 { font-size: 20px; border-bottom: 1px solid rgba(255,255,255,0.3); padding-bottom: 10px; font-weight: 700; }
.news-sidebar ul li { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.2); font-size: 14px; }

.welcome-box { background-color: #ffffff; border: 1px solid #eee; border-radius: 15px; }
.welcome-title { color: #1a528f; font-size: 24px; border-bottom: 2px solid #1a528f; display: inline-block; padding-bottom: 5px; font-family: 'Cinzel', serif; font-weight: 700; }

/* =========================================
   GALLERY
========================================= */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.gallery-item { position: relative; overflow: hidden; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.gallery-caption { position: absolute; bottom: 0; width: 100%; background: rgba(26, 82, 143, 0.8); color: white; padding: 10px; text-align: center; }
.gallery-caption p { margin: 0; }
.event-name { font-weight: bold; }
.event-date { font-size: 0.8rem; }
.expandable-img { cursor: pointer; transition: opacity 0.2s; }
.expandable-img:hover { opacity: 0.85; }

/* =========================================
   FOOTER
========================================= */
.main-footer { background-color: #1a528f; color: white; padding-top: 40px; }
.footer-heading { border-bottom: 2px solid #2fa184; padding-bottom: 10px; margin-bottom: 15px; display: inline-block; font-family: 'Cinzel', serif; }
.footer-text, .footer-text a, .main-footer p, .main-footer span, .main-footer li { color: #ffffff !important; text-decoration: none; font-size: 0.85rem;  }
.social-icons a { color: white; font-size: 1.5rem; margin-right: 15px; transition: color 0.3s; }
.social-icons a:hover { color: #2fa184; }
.social-icons a.tw:hover { color: #000000; } 

/* =========================================
   WHATSAPP BUTTON (With Blinking Animation)
========================================= */
.whatsapp-float { 
    position: fixed; 
    width: 60px; 
    height: 60px; 
    bottom: 30px; 
    right: 30px; 
    background-color: #25d366; 
    color: #FFF; 
    border-radius: 50px; 
    text-align: center; 
    font-size: 30px; 
    z-index: 99998; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-decoration: none; 
    transition: transform 0.2s;
    animation: whatsapp-glow 2s infinite; 
}
.whatsapp-float:hover { transform: scale(1.1); color: white; }

@keyframes whatsapp-glow {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* =========================================
   AI CHATBOT (Minimized Pill With Animation)
========================================= */
#chat-minimized {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background-color: #1a528f;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    z-index: 99999;
    display: flex;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: ai-glow 2s infinite; 
}
#chat-minimized:hover { transform: translateY(-2px); }

@keyframes ai-glow {
    0% { box-shadow: 0 0 0 0 rgba(26, 82, 143, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(26, 82, 143, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 82, 143, 0); }
}

/* =========================================
   CHATBOT OPEN WINDOW
========================================= */
#chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 400px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    z-index: 99999;
    overflow: visible !important; 
    font-family: 'Poppins', sans-serif;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid #e0e0e0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
#chat-window.chat-hidden { opacity: 0; pointer-events: none; transform: translateY(20px); }

.chat-header { 
    background-color: #1a528f; color: white; padding: 15px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; 
    border-radius: 11px 11px 0 0; 
}
.chat-footer { 
    display: flex; padding: 10px; background: #ffffff; border-top: 1px solid #eee; align-items: center; 
    border-radius: 0 0 11px 11px; 
}

.close-btn { font-size: 1.2rem; cursor: pointer; transition: color 0.2s; z-index: 100000; position: relative;}
.close-btn:hover { color: #cce5ff; }

.chat-body { flex: 1; padding: 15px; overflow-y: auto; background-color: #f4f7f6; display: flex; flex-direction: column; gap: 10px; }
.message { max-width: 80%; padding: 10px 14px; border-radius: 15px; font-size: 0.9rem; line-height: 1.4; word-wrap: break-word; animation: fadeIn 0.3s ease; }
.bot-message { align-self: flex-start; background-color: #ffffff; color: #333; border: 1px solid #e0e0e0; border-bottom-left-radius: 4px; }
.user-message { align-self: flex-end; background-color: #1a528f; color: white; border-bottom-right-radius: 4px; }

.typing-indicator { display: flex; gap: 4px; padding: 12px 16px; background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 15px; border-bottom-left-radius: 4px; align-self: flex-start; width: fit-content; }
.typing-dot { width: 6px; height: 6px; background-color: #a0a0a0; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

#chat-input { flex: 1; padding: 10px 15px; border: 1px solid #ddd; border-radius: 20px; outline: none; font-size: 0.9rem; transition: border-color 0.2s; }
#chat-input:focus { border-color: #1a528f; }
.send-btn { background-color: transparent; color: #1a528f; border: none; font-size: 1.2rem; padding: 5px 10px; margin-left: 5px; cursor: pointer; transition: transform 0.1s; }
.send-btn:hover { transform: scale(1.1); }
.send-btn:active { transform: scale(0.95); }

/* =========================================
   GENIE POP-OUT & WIGGLE STYLES
========================================= */
.genie-avatar-container {
    position: relative;
    width: 45px; 
    height: 45px;
}

.genie-popout {
    position: absolute;
    bottom: -10px; 
    left: -35px; 
    width: 130px; 
    height: auto;
    max-width: none;
    z-index: 999999; 
    pointer-events: none; 
    transform-origin: 30% 90%; 
    animation: genieWiggle 3.5s ease-in-out infinite;
    filter: drop-shadow(3px 5px 5px rgba(0,0,0,0.4)); 
}

@keyframes genieWiggle {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-3deg) scale(1.02); }
    50% { transform: rotate(1deg) scale(1); }
    75% { transform: rotate(-2deg) scale(1.01); }
    100% { transform: rotate(0deg) scale(1); }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* =========================================
   MOBILE CHATBOX STYLES
========================================= */
@media (max-width: 480px) {
    #chat-window { 
        bottom: 90px; 
        right: 15px; 
        width: calc(100% - 60px); 
        height: 420px; 
        max-height: 65vh; 
    }
    .genie-popout {
        width: 110px; 
        left: -30px;
    }
    #chat-minimized { 
        bottom: 90px; 
        right: 15px; 
    }
}

/* =========================================
   MOBILE HEADER FIX
   ========================================= */
@media (max-width: 767px) {

    /* First row: Logo + School Name */
    .top-header .row {
        row-gap: 10px;
    }

    .top-header .col-md-6 {
        width: 100%;
        flex: 0 0 100%;
        justify-content: center;
    }

    .main-logo {
        width: 55px;
        height: 55px;
    }

    .school-name-main {
        font-size: 1.65rem;
        line-height: 0.95;
    }

    .school-sub-main {
        font-size: 0.62rem;
        letter-spacing: 1px;
    }

    /* Second row: தமிழ் button + marquee */
    .top-header .col-md-1,
    .top-header .col-md-5 {
        flex: unset;
        max-width: unset;
    }

    .top-header .col-md-1 {
        width: auto;
        padding-right: 6px;
    }

    .top-header .col-md-5 {
        width: calc(100% - 90px);
        padding-left: 0;
    }

    #langToggle {
        white-space: nowrap;
        padding: .25rem .6rem;
    }

    .top-news-container {
        width: 100%;
    }

    .news-label {
        padding: 6px 10px;
        font-size: .72rem;
    }

    marquee {
        font-size: .78rem;
    }
}