/* style.css - COMPLETE FIXED VERSION */

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Use higher resolution logo */
    .high-dpi-logo {
        background-image: url('logo@2x.png');
    }
}

/* Prevent zoom on mobile */
@media (max-width: 768px) {
    .responsive-text {
        font-size: clamp(1rem, 4vw, 1.5rem);
    }
}

/* ===== DATA TICKER - GUARANTEED WORKING ===== */
.data-ticker-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    background: #0c4a6e;
}

.data-ticker {
    display: flex;
    animation: dataTickerAnimation 25s linear infinite;
    white-space: nowrap;
}

.data-ticker-content {
    display: flex;
    flex-shrink: 0;
    align-items: center;
}

.data-ticker-content span {
    white-space: nowrap;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
}

@keyframes dataTickerAnimation {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ===== PARTNER LOGOS - FIXED LEFT-TO-RIGHT MOVEMENT ===== */
.partners-section {
    position: relative;
    overflow: hidden;
}

.logos-slide {
    display: flex;
    animation: logoAnimation 40s linear infinite;
    width: max-content;
}

.logos-slide img {
    height: 60px;
    width: auto;
    margin: 0 48px; /* Increased spacing */
    flex-shrink: 0;
    filter: grayscale(0%); /* Logos in color */
    opacity: 1; /* Full opacity */
    transition: all 0.3s ease;
}

.logos-slide img:hover {
    transform: scale(1.1); /* Slightly larger hover effect */
}

/* Left-to-right animation */
@keyframes logoAnimation {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .data-ticker {
        animation: dataTickerAnimation 20s linear infinite;
    }
    
    .logos-slide {
        animation: logoAnimation 30s linear infinite;
    }
    
    .logos-slide img {
        height: 40px;
        margin: 0 32px; /* Adjusted spacing for mobile */
    }
}

/* Navigation Styles */
.nav-item button {
    transition: all 0.3s ease;
}

.nav-item:hover button {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-item {
    position: relative;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 50;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.3s ease;
    visibility: hidden;
    min-width: 200px;
}

.mega-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.submenu {
    position: relative;
}

.submenu > a::after {
    content: none !important;
    margin-left: 5px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.submenu-right {
    left: auto !important;
    right: 0;
}

.submenu:hover > a::after {
    transform: translateX(3px);
}

.sub-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    border: 1px solid #e5e7eb;
    min-width: 220px;
    z-index: 60;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
    transition: all 0.3s ease;
    visibility: hidden;
}

.submenu:hover .sub-submenu {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
}

.mega-menu, .sub-submenu {
    padding: 15px;
    white-space: nowrap;
}

.mega-menu a, .sub-submenu a {
    padding: 8px 12px;
    display: block;
    color: #374151;
    transition: all 0.2s ease;
}

.mega-menu a:hover, .sub-submenu a:hover {
    background-color: #f3f4f6;
    color: #0c4a6e;
    border-radius: 4px;
}

.mega-menu .grid {
    gap: 20px;
}

.mega-menu h3 {
    font-weight: 600;
    margin-bottom: 12px;
    color: #0c4a6e;
}

.mega-menu ul {
    gap: 8px;
}

/* Animations */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(12, 74, 110, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(12, 74, 110, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(12, 74, 110, 0);
    }
}

/* Hero Section */
.hero-gradient {
    background: linear-gradient(90deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%);
}

/* Statistics Cards */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Charts */
.chart-container {
    height: 300px;
    width: 100%;
}

/* Custom Switch */
.custom-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.custom-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #0c4a6e;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Tab Button */
.tab-button {
    position: relative;
    overflow: hidden;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #0c4a6e;
}

/* Mobile Menu */
.mobile-menu-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 40;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-menu-toggle {
    display: none;
}

.mobile-menu-container.active {
    display: block;
}

.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-submenu.active {
    max-height: 1000px;
}

.mobile-submenu-toggle i {
    transition: transform 0.3s ease;
}

.mobile-submenu-toggle.active i {
    transform: rotate(180deg);
}

/* Responsive Styles */
@media (max-width: 1023px) {
    .lg\\:flex {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu-container.active {
        display: block;
    }
    
    .top-bar-mobile-center {
        justify-content: center !important;
        width: 100%;
    }
    
    .hero-swiper h1 {
        font-size: 1.8rem;
    }
    
    .hero-swiper p {
        font-size: 1rem;
    }
    
    .stat-card p {
        font-size: 1.5rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 767px) {
    .hero-swiper h1 {
        font-size: 1.5rem;
    }
    
    .hero-swiper p {
        font-size: 0.9rem;
    }
    
    .stat-card p {
        font-size: 1.25rem;
    }
    
    .chart-container {
        height: 200px;
    }
    
    header .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 2000px) {
    .container {
        max-width: 1800px;
    }
    
    .text-4xl {
        font-size: 3.5rem;
    }
    
    .text-2xl {
        font-size: 2.5rem;
    }
    
    .text-lg {
        font-size: 1.5rem;
    }
    
    .text-sm {
        font-size: 1.25rem;
    }
    
    .hero-swiper h1 {
        font-size: 4rem;
    }
    
    .hero-swiper p {
        font-size: 1.75rem;
    }
    
    .stat-card p {
        font-size: 3rem;
    }
    
    .chart-container {
        height: 500px;
    }
    
    .logos-slide img {
        height: 120px;
    }
}

header {
    position: relative;
}

@media (max-width: 1023px) {
    header .container {
        position: relative;
    }
}

/* FIXED STYLES */

/* Fix for header cut-off on mobile */
@media (max-width: 1023px) {
    header .flex-nowrap {
        flex-wrap: nowrap;
    }
    
    .mobile-menu-toggle {
        flex-shrink: 0;
    }
    
    .flex-shrink-0.min-w-0 {
        min-width: 0;
        flex-shrink: 1;
        overflow: hidden;
    }
    
    /* Fix header text cut-off */
    .header-title {
        max-width: 180px;
        min-width: 0;
    }
    
    .header-title div {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Hero slider title positioning - only show title at bottom left */
.hero-swiper .swiper-slide .container .w-full {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 2rem;
}

.hero-swiper .swiper-slide .container .w-full h1 {
    margin-bottom: 0;
    text-align: left;
}

.hero-swiper .swiper-slide .container .w-full p {
    display: none;
}

/* INCREASED BORDER AREA FOR DESKTOP MENU */
.mega-menu .mega-submenu-column {
    min-width: 320px;
    padding: 12px 16px;
}

.mega-menu .mega-submenu-column h3 {
    white-space: normal;
    line-height: 1.3;
    padding: 8px 12px;
    margin: 0 -12px 12px -12px;
    background-color: #f8fafc;
    border-radius: 6px;
}

/* Ensure Social, Demographic & Health Statistics shows fully */
.mega-menu .mega-submenu-column h3.text-full {
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    min-height: auto;
}

/* Mobile menu improvements */
.mobile-menu-container {
    z-index: 1000;
}

.mobile-submenu {
    background-color: #f9fafb;
    border-radius: 8px;
    margin: 4px 0;
}

.mobile-submenu a {
    padding: 10px 16px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.mobile-submenu a:hover {
    border-left-color: #0c4a6e;
    background-color: #f3f4f6;
}

/* Emergency animations backup */
@keyframes emergencyTicker {
    0% { transform: translateX(0) !important; }
    100% { transform: translateX(-50%) !important; }
}

@keyframes emergencyLogos {
    0% { transform: translateX(-50%) !important; }
    100% { transform: translateX(0%) !important; }
}

.data-ticker.emergency {
    animation: emergencyTicker 25s linear infinite !important;
    display: flex !important;
    white-space: nowrap !important;
}

.logos-slide.emergency {
    animation: emergencyLogos 40s linear infinite !important;
    display: flex !important;
    width: max-content !important;
}

.logos-slide.emergency img {
    filter: grayscale(0%) !important;
    opacity: 1 !important;
    margin: 0 48px !important;
}

/* ===== MAP STYLES ===== */
#map {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

#map-loading {
    z-index: 20;
    background: rgba(255, 255, 255, 0.95);
    transition: opacity 0.3s ease;
}

.custom-marker {
    background: transparent !important;
    border: none !important;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Inter', sans-serif !important;
}

.leaflet-popup-tip {
    box-shadow: none !important;
}

/* Pulse animation for markers */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(12, 74, 110, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(12, 74, 110, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(12, 74, 110, 0);
    }
}

/* State highlight effect */
.state-highlight {
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
    0%, 100% {
        fill-opacity: 0.3;
    }
    50% {
        fill-opacity: 0.6;
    }
}

/* Map controls */
.leaflet-control-zoom a {
    background-color: white !important;
    color: #0c4a6e !important;
    border: none !important;
    border-radius: 4px !important;
    margin: 2px !important;
}

.leaflet-control-zoom a:hover {
    background-color: #0c4a6e !important;
    color: white !important;
}

/* Improved dropdown styles */
.topbar-item .absolute {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.topbar-item:hover .absolute {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
}

/* Mobile menu improvements */
.mobile-submenu {
    transition: all 0.3s ease;
}

.rotate-180 {
    transform: rotate(180deg);
}

/* Ensure Resources submenu is wide enough */
.w-72 {
    width: 18rem;
}

/* Better spacing for top bar items */
.space-x-2 > * + * {
    margin-left: 0.5rem;
}

/* ===== MOBILE MENU FIXES ===== */
.mobile-menu-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-menu-container:not(.hidden) {
    display: block !important;
}

.mobile-menu-container.hidden {
    display: none !important;
}

/* Mobile menu item styles */
.mobile-nav-item {
    border-bottom: 1px solid #f3f4f6;
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

.mobile-submenu-toggle {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #0c4a6e;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-submenu-toggle:hover {
    background-color: #f8fafc;
}

.mobile-submenu {
    background-color: #f9fafb;
    border-left: 3px solid #0c4a6e;
    margin-left: 16px;
}

.mobile-submenu:not(.hidden) {
    display: block !important;
}

.mobile-submenu.hidden {
    display: none !important;
}

.mobile-submenu a {
    display: block;
    padding: 10px 20px;
    color: #374151;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.mobile-submenu a:hover {
    background-color: #f3f4f6;
    border-left-color: #0c4a6e;
    color: #0c4a6e;
}

/*
 * FINAL SUBMENU FIXES: Ensure the elements are clickable and visible.
 */
.mobile-submenu-toggle {
    /* Ensure the button is always in the foreground for clicks */
    z-index: 10; 
    /* Prevent any external rules from disabling clicks */
    pointer-events: auto !important; 
}

.mobile-submenu {
    /* Ensure the submenu is never visually hidden by an 'opacity: 0' or 'max-height: 0' rule */
    max-height: none !important;
    opacity: 1 !important;
}

/* Re-assert the visibility logic with highest priority */
.mobile-submenu.hidden {
    display: none !important;
}

.mobile-submenu:not(.hidden) {
    display: block !important;
}

/* Rotate animation for dropdown icons */
.rotate-180 {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Ensure the mobile menu button is visible */
.mobile-menu-toggle {
    display: flex !important;
}

@media (min-width: 1024px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .mobile-menu-container {
        display: none !important;
    }
}

/* ===== MOBILE MENU FIXES ===== */
.mobile-menu-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-menu-container:not(.hidden) {
    display: block !important;
}

.mobile-menu-container.hidden {
    display: none !important;
}

.mobile-submenu:not(.hidden) {
    display: block !important;
}

.mobile-submenu.hidden {
    display: none !important;
}

/* Rotate animation for dropdown icons */
.rotate-180 {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Mobile menu item styles */
.mobile-nav-item {
    border-bottom: 1px solid #f3f4f6;
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

.mobile-submenu-toggle {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.mobile-submenu-toggle:hover {
    background-color: #f8fafc;
}

.mobile-submenu {
    background-color: #f9fafb;
    border-left: 2px solid #0c4a6e;
    margin-left: 16px;
}

.mobile-submenu a {
    display: block;
    color: #374151;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.mobile-submenu a:hover {
    background-color: #f3f4f6;
    border-left-color: #0c4a6e;
    color: #0c4a6e;
}
/*
 * Submenu Font Size Increase
 * Targets the links inside the mobile-submenu to ensure better readability.
 */
.mobile-submenu a {
    /* Sets the font size to 16px (standard base size) to override text-sm */
    font-size: 1rem !important;
    /* Optional: You may also want to slightly increase the vertical space */
    padding-top: 0.5rem !important; 
    padding-bottom: 0.5rem !important;
}

/* Optional: If you want to increase the padding/height of the main toggle buttons slightly */
.mobile-submenu-toggle {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}



/* Leadership Page Styles */
.leadership-card {
  transition: all 0.3s ease;
  border: 1px solid #e5e7eb;
}

.leadership-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: #0c4a6e;
}

.leadership-role {
  color: #0c4a6e;
  font-weight: 600;
}

.leadership-department {
  color: #6b7280;
  font-size: 0.875rem;
}

.filter-button {
  transition: all 0.3s ease;
}

.filter-button.active {
  background-color: #0c4a6e;
  color: white;
}

.leadership-image {
  transition: all 0.3s ease;
}

.leadership-card:hover .leadership-image {
  transform: scale(1.05);
}


/* Director General Page Styles */
.profile-header {
  background: linear-gradient(135deg, #0c4a6e 0%, #1e40af 100%);
  color: white;
}

.contact-info a {
  transition: all 0.3s ease;
}

.contact-info a:hover {
  color: #eab308;
}

.publication-item {
  border-left: 3px solid #0c4a6e;
  transition: all 0.3s ease;
}

.publication-item:hover {
  background-color: #f8fafc;
  transform: translateX(5px);
}

.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background: #0c4a6e;
}

.timeline-item {
  position: relative;
  padding-left: 50px;
  margin-bottom: 30px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0c4a6e;
  border: 3px solid white;
  box-shadow: 0 0 0 3px #0c4a6e;
}

@media (max-width: 768px) {
  .timeline::before {
    left: 15px;
  }
  
  .timeline-item {
    padding-left: 40px;
  }
  
  .timeline-item::before {
    left: 7px;
  }
}