/* --- 1. SETUP & ROOT VARIABLES --- */
html[data-theme="dark"] {
    --bg-dark: #0B132B;
    --bg-light: #1C2541;
    --text-primary: #EFEFEF;
    --text-secondary: #8D99AE;
    --accent-cyan: #00BFFF;
    --accent-orange: #FF7B00;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] {
    --bg-dark: #F0F8FF;
    --bg-light: #FFFFFF;
    --text-primary: #0B132B;
    --text-secondary: #5C677D;
    --accent-cyan: #007BFF;
    --accent-orange: #E85D04;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
}

/* Default to dark theme */
:root { --bg-dark: #0B132B; --bg-light: #1C2541; --text-primary: #EFEFEF; --text-secondary: #8D99AE; --accent-cyan: #00BFFF; --accent-orange: #FF7B00; --glass-bg: rgba(255, 255, 255, 0.05); --glass-border: rgba(255, 255, 255, 0.1); }

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Roboto Flex', sans-serif;
    padding-top: 70px;
    background-image: radial-gradient(var(--text-secondary) 0.5px, transparent 0.5px);
    background-size: 20px 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
}

section {
    padding: 80px 0;
}

/* --- 2. CORE COMPONENTS --- */

.btn-cta {
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-cyan));
    color: var(--bg-dark);
    font-weight: 700;
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    transition: all 0.3s ease;
    background-size: 200% auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-cta:hover {
    background-position: right center;
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--accent-cyan);
    color: var(--bg-dark);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

.btn-cta .material-symbols-outlined {
    vertical-align: text-bottom;
}


/* --- 3. NAVIGATION BAR --- */
.navbar {
    background: rgba(11, 19, 43, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

/* Theme Switcher */
.theme-switcher {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 50px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.theme-switcher:hover {
    border-color: var(--accent-cyan);
}
.theme-switcher .material-symbols-outlined {
    font-size: 20px;
}

/* --- 4. HERO SECTION --- */
.hero-section {
    min-height: 90vh;
    background: linear-gradient(180deg, rgba(11, 19, 43, 0.6), var(--bg-dark)), url('https://i.imgur.com/GGrf477.jpg') no-repeat center center;
    background-size: cover;
}


/* --- 5. ABOUT & FEATURE ICONS --- */
.icon-feature {
    font-size: 3rem;
    color: var(--accent-cyan);
    font-variation-settings: 'wght' 300;
}


/* --- 6. SERVICES - GLASSMORPHISM CARDS --- */
.service-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px 30px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    height: 100%;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 30px rgba(0, 191, 255, 0.3);
}

.service-card .card-icon {
    font-size: 3.5rem;
    color: var(--accent-cyan);
    font-variation-settings: 'wght' 200;
}


/* --- 7. CONTACT FORM --- */
.contact-form .form-control {
    background-color: var(--bg-light);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 8px;
}

.contact-form .form-control:focus {
    background-color: var(--bg-light);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
    color: var(--text-primary);
}

.contact-form .form-floating > label {
    color: var(--text-secondary);
}

/* Contact section link color fix for theming */
.contact-info a {
    color: var(--text-primary);
}

/* Why Us List */
.why-us-list .list-group-item {
    background-color: transparent;
    border-color: var(--glass-border);
    color: var(--text-primary);
    padding: 1rem 0;
    font-size: 1.1rem;
}

.why-us-list .list-group-item:first-child {
    border-top: none;
}


html[data-theme="light"] .contact-form .form-control {
    background-color: #fff;
}
html[data-theme="light"] .contact-form .form-control:focus {
    background-color: #fff;
}

/* More Schemes Section Card */
#more-schemes .card {
    border: 1px solid var(--glass-border);
}
#more-schemes .card-img-top {
    height: 250px;
    object-fit: cover;
}
/* Form Success/Error Messages */
#form-message.success {
    color: var(--accent-cyan);
    font-weight: bold;
}
#form-message.error {
    color: var(--accent-orange);
    font-weight: bold;
}

/* Scheme Section Tabs & Table */
.scheme-tabs {
    border-bottom: 1px solid var(--glass-border);
}
.scheme-tabs .nav-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
}
.scheme-tabs .nav-link.active,
.scheme-tabs .nav-link:hover {
    color: var(--accent-cyan);
    border-bottom: 2px solid var(--accent-cyan);
}
.scheme-tab-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
}
.scheme-table {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}
.scheme-table th {
    background-color: rgba(0, 191, 255, 0.1);
    color: var(--accent-cyan);
}

/* Light theme adjustments for tables and tabs */
html[data-theme="light"] .table-dark {
    --bs-table-bg: var(--glass-bg);
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--glass-border);
    --bs-table-striped-bg: rgba(0,0,0,0.03);
}


/* 8. HERO CAROUSEL STYLES */
.hero-section .carousel,
.hero-section .carousel-inner,
.hero-section .carousel-item {
    height: 90vh;
}

.hero-section .carousel-item {
    background-size: cover;
    background-position: center;
}

.hero-section .carousel-caption {
    position: absolute;
    right: 15%;
    left: 15%;
    bottom: 20%;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    color: #fff;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 16px;
}

/* 9. PARTNERS LOGO SECTION */
.partner-logo {
    height: 60px;
    max-width: 180px;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.7);
    transition: all 0.3s ease;
}

.partner-logo:hover {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

/* 10. HERO IMAGE - KEN BURNS ANIMATION */
@keyframes kenburns-animation {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.1);
  }
}

.hero-section .carousel-item.active {
  animation: kenburns-animation 8s ease-out forwards;
}

/* 11. FLOATING WHATSAPP BUTTON */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    z-index: 100;
    transition: transform 0.3s ease;
}
.whatsapp-float:hover {
    transform: scale(1.1);
}
.whatsapp-float img {
    width: 36px;
    height: 36px;
    margin-top: 12px;
}

/* Hide one of the theme icons based on the current theme */
html[data-theme="dark"] .theme-switcher .light-icon { display: inline-block; }
html[data-theme="dark"] .theme-switcher .dark-icon { display: none; }

html[data-theme="light"] .theme-switcher .light-icon { display: none; }
html[data-theme="light"] .theme-switcher .dark-icon { display: inline-block; }


/* ============================================= */
/* 12. GALLERY STYLES                              */
/* ============================================= */

/* Gallery Image Base */
.gallery-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 0.4s ease;
}

@media (max-width: 767.98px) {
    .gallery-image {
        height: 220px;
    }
}

/* Gallery Card (clickable image wrapper) */
.gallery-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-cyan);
    box-shadow: 0 12px 40px rgba(0, 191, 255, 0.2);
}

.gallery-card:hover .gallery-image {
    transform: scale(1.08);
}

.gallery-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.gallery-card:hover .gallery-card-overlay {
    opacity: 1;
}

.gallery-card-overlay .material-symbols-outlined {
    font-size: 40px;
    color: #fff;
    background: rgba(0, 191, 255, 0.3);
    border-radius: 50%;
    padding: 12px;
    backdrop-filter: blur(5px);
}

/* Gallery Fade In Animation */
@keyframes galleryFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-fade-in {
    animation: galleryFadeIn 0.5s ease forwards;
    opacity: 0;
}

/* Gallery Count Badge */
.badge-gallery-count {
    display: inline-block;
    padding: 8px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--accent-cyan);
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
}

/* ============================================= */
/* 13. LIGHTBOX MODAL                              */
/* ============================================= */

.lightbox-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.lightbox-image {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -10px;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 59, 48, 0.8);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(0, 191, 255, 0.4);
    border-color: var(--accent-cyan);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 10px;
}

.lightbox-next {
    right: 10px;
}

.lightbox-counter {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

/* Lightbox modal backdrop */
#lightboxModal .modal-dialog {
    max-width: 95vw;
}

@media (max-width: 767.98px) {
    .lightbox-image {
        max-width: 100%;
        max-height: 70vh;
    }
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    .lightbox-prev { left: 5px; }
    .lightbox-next { right: 5px; }
}


/* ============================================= */
/* 14. ADMIN GALLERY MANAGEMENT                    */
/* ============================================= */

/* Upload Zone */
.gallery-upload-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-dark);
}

.gallery-upload-zone.dragover {
    border-color: var(--accent-cyan);
    background: rgba(0, 191, 255, 0.05);
    box-shadow: 0 0 30px rgba(0, 191, 255, 0.15);
}

/* Admin Gallery Grid Items */
.admin-gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.admin-gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.admin-gallery-item:hover img {
    transform: scale(1.05);
}

.admin-gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-gallery-item:hover .admin-gallery-overlay {
    opacity: 1;
}

.btn-gallery-delete {
    background: rgba(255, 59, 48, 0.85);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-gallery-delete:hover {
    background: #ff3b30;
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.5);
}

/* Gallery Preview Section on Homepage */
.gallery-preview-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-preview-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-cyan);
    box-shadow: 0 12px 40px rgba(0, 191, 255, 0.2);
}

.gallery-preview-card img {
    transition: transform 0.4s ease;
}

.gallery-preview-card:hover img {
    transform: scale(1.08);
}

/* Light theme navbar fix */
html[data-theme="light"] .navbar {
    background: rgba(240, 248, 255, 0.85);
}
html[data-theme="light"] .navbar .nav-link {
    color: var(--text-primary);
}
html[data-theme="light"] .navbar .nav-link:hover,
html[data-theme="light"] .navbar .nav-link.active {
    color: var(--accent-cyan);
}
html[data-theme="light"] .btn-outline-light {
    color: var(--text-primary);
    border-color: var(--glass-border);
}
html[data-theme="light"] .btn-outline-light:hover {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: #fff;
}
html[data-theme="light"] .gallery-upload-zone {
    background: rgba(0,0,0,0.02);
}