/* Enhanced Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes glow {
    0% { box-shadow: 0 0 20px rgba(236, 72, 153, 0.3); }
    100% { box-shadow: 0 0 40px rgba(236, 72, 153, 0.6); }
}

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

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

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: rgba(255, 255, 255, 0.8); }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: all 0.8s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Gradient Background */
.hero-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
}

/* Glass Effect */
.glass {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-card {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Hover Effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Navigation */
.navbar-glass {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile menu animation */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.open {
    transform: translateX(0);
}

/* Section animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Particle Background */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

/* Shimmer effect for buttons */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2.5s infinite;
}

/* Image overlay effects */
.image-overlay {
    position: relative;
    overflow: hidden;
}

.image-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.image-overlay:hover::before {
    opacity: 1;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

/* Text gradient */
.text-gradient {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Ripple effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

/* Hero title typing effect */
.hero-title {
    border-right: 3px solid rgba(255, 255, 255, 0.8);
    animation: blink-caret 1s infinite;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f1f1;
}

/* Enhance focus states for accessibility */
a:focus, button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Counter animation styles */
.counter {
    transition: all 0.3s ease;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .glass {
        backdrop-filter: blur(15px);
        background: rgba(255, 255, 255, 0.2);
    }
    
    .glass-card {
        backdrop-filter: blur(8px);
        background: rgba(255, 255, 255, 0.9);
    }
    
    .hero-gradient {
        background-attachment: scroll;
    }
    
    .particle {
        display: none; /* Hide particles on mobile for performance */
    }
}

/* Additional Animation Classes */
.animate-bounce-in {
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Interactive Elements */
.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Card Hover Animations */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 1.5s infinite;
}

/* Utility Classes */
.blur-sm {
    backdrop-filter: blur(4px);
}

.blur-md {
    backdrop-filter: blur(12px);
}

.blur-lg {
    backdrop-filter: blur(20px);
}

.gradient-text {
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .glass-card {
        background: rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Print Styles */
@media print {
    .loading-screen,
    .particles,
    nav,
    footer {
        display: none !important;
    }
    
    .glass,
    .glass-card {
        background: white !important;
        backdrop-filter: none !important;
    }
}

/* Fix for Get in Touch section on mobile */
@media (max-width: 768px) {
  /* Override the existing contact grid rules */
  #contact {
    display: block !important;
    align-items: stretch !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
  }

  #contact .grid {
    display: block !important;
    align-items: stretch !important;
    gap: 1rem !important;
  }

  #contact .grid > div:first-child {
    display: block !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    margin-bottom: 1rem;
  }

  /* Ensure both contact boxes stack properly */
  #contact .glass-card,
  #contact .grid > div {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 1rem;
    box-sizing: border-box;
  }

  /* Fix form elements inside contact section */
  #contact input,
  #contact textarea,
  #contact button {
    width: 100% !important;
    box-sizing: border-box;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Additional fix for very small screens */
@media (max-width: 480px) {
  #contact .glass-card {
    padding: 1rem !important;
    margin: 0.5rem 0 !important;
  }
  
  #contact h3 {
    font-size: 1.2rem !important;
  }
}

button:focus {
    outline: none;
    box-shadow: none;
}

/* ========================================
   ENHANCED MOBILE RESPONSIVENESS
   ======================================== */

@media (max-width: 768px) {
    /* Better mobile typography */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    /* Improve touch targets for better mobile UX */
    a, button {
        min-height: 44px;
    }
    
    /* Better spacing on mobile */
    .hover-lift {
        margin-bottom: 1rem;
    }
    
    /* Optimize images for mobile */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Better mobile padding for sections */
    section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    /* Reduce excessive animations on mobile for performance */
    /* REMOVED THE * SELECTOR HERE TO FIX HERO ANIMATION SPEED */
    
    /* Mobile logo sizing */
    nav img {
        height: 2.5rem !important;
    }
    
    nav h1 {
        font-size: 0.875rem !important;
    }
    
    nav p {
        font-size: 0.625rem !important;
    }
    
    /* Mobile navigation improvements */
    nav .flex.items-center {
        max-width: 70%;
    }
    
    /* Better mobile hero section */
    header h1 {
        font-size: 2.5rem !important;
        padding: 0 1rem;
    }
    
    header p {
        font-size: 1rem !important;
        padding: 0 1rem;
    }
    
    /* Mobile-friendly buttons */
    .btn-primary {
        width: 100%;
        padding: 1rem !important;
        font-size: 1rem !important;
        margin-bottom: 0.5rem;
    }
    
    /* Gallery slider height adjustment */
    .slider-image {
        object-fit: contain !important;
    }
    
    /* Better mobile cards */
    .glass-card {
        padding: 1.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Stack video grid on mobile */
    video {
        width: 100% !important;
        height: auto !important;
        margin-bottom: 1rem;
    }
    
    /* Better statistics grid */
    .counter {
        font-size: 2.5rem !important;
    }
    
    /* Mobile facility cards */
    .text-2xl {
        font-size: 1.25rem !important;
    }
    
    /* Better mobile contact section */
    input, textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* Mobile footer */
    footer {
        font-size: 0.875rem;
    }
    
    footer h4 {
        font-size: 1.125rem !important;
    }
    
    /* Leadership section mobile */
    .w-48 {
        width: 10rem !important;
        height: 10rem !important;
    }
}

/* Very small mobile devices */
@media (max-width: 480px) {
    /* Extra small screens */
    header h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    .glass-card {
        padding: 1rem !important;
    }
    
    /* Smaller nav logo */
    nav img {
        height: 2rem !important;
        margin-right: 0.5rem !important;
    }
    
    nav h1 {
        font-size: 0.75rem !important;
    }
    
    nav p {
        display: none !important;
    }
    
    /* Compact statistics */
    .counter {
        font-size: 2rem !important;
    }
    
    /* Smaller leadership photos */
    .w-48 {
        width: 8rem !important;
        height: 8rem !important;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        min-height: 100vh;
    }
    
    .slider-image {
        height: 50vh !important;
    }
}
/* ========================================
   CRITICAL MOBILE FIXES
   ======================================== */

/* Mobile First - Base styles for mobile */
@media screen and (max-width: 768px) {
    /* RESET PROBLEMATIC STYLES */
    * {
        box-sizing: border-box;
    }
    
    html {
        overflow-x: hidden;
        width: 100%;
    }
    
    body {
        overflow-x: hidden;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* NAVIGATION - MOBILE */
    nav {
        padding: 0 !important;
    }
    
    nav .max-w-7xl {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    nav .h-20 {
        height: 4rem !important;
    }
    
    nav .flex.items-center {
        gap: 0.5rem;
    }
    
    nav img {
        height: 2rem !important;
        width: auto !important;
        margin-right: 0.5rem !important;
    }
    
    nav h1 {
        font-size: 0.75rem !important;
        line-height: 1 !important;
        margin: 0 !important;
    }
    
    nav p {
        font-size: 0.6rem !important;
        display: none !important;
    }
    
    /* HERO SECTION - MOBILE */
    header {
        min-height: 100vh !important;
        padding-top: 4rem !important;
    }
    
    header h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
        padding: 0 1rem !important;
    }
    
    header .text-xl {
        font-size: 1.125rem !important;
    }
    
    header .text-lg {
        font-size: 0.9rem !important;
        padding: 0 1rem !important;
    }
    
    /* BUTTONS - MOBILE */
    .btn-primary {
        width: 90% !important;
        max-width: 320px !important;
        margin: 0 auto !important;
        display: block !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
        text-align: center !important;
    }
    
    header .flex-col {
        width: 100% !important;
        align-items: center !important;
    }
    
    header .glass {
        width: 90% !important;
        max-width: 320px !important;
        margin: 0 auto !important;
        display: block !important;
        text-align: center !important;
        padding: 0.875rem 1.5rem !important;
    }
    
    /* SECTIONS - MOBILE */
    section {
        padding: 2.5rem 1rem !important;
        overflow-x: hidden !important;
    }
    
    .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* HEADINGS - MOBILE */
    h2 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }
    
    h3 {
        font-size: 1.125rem !important;
        line-height: 1.4 !important;
    }
    
    .text-xl {
        font-size: 1rem !important;
    }
    
    .text-2xl {
        font-size: 1.25rem !important;
    }
    
    .text-4xl {
        font-size: 1.75rem !important;
    }
    
    .text-5xl {
        font-size: 2rem !important;
    }
    
    /* STATISTICS GRID - MOBILE */
    .grid.grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .grid.md\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .counter {
        font-size: 2.5rem !important;
    }
    
    /* CARDS - MOBILE */
    .glass-card {
        padding: 1.25rem !important;
        margin-bottom: 1rem !important;
        border-radius: 1rem !important;
    }
    
    .hover-lift {
        transform: none !important;
        transition: none !important;
    }
    
    .hover-lift:hover {
        transform: none !important;
    }
    
    /* GRIDS - MOBILE */
    .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .grid.md\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .grid.lg\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    /* GALLERY - MOBILE */
    #gallery .relative {
        height: 300px !important;
    }
    
    .slider-image {
        object-fit: contain !important;
        background: #1a1a1a !important;
    }
    
    #prev-btn, #next-btn {
        padding: 0.75rem !important;
    }
    
    #prev-btn i, #next-btn i {
        font-size: 1rem !important;
    }
    
    /* VIDEO - MOBILE */
    video {
        width: 100% !important;
        height: auto !important;
        margin-bottom: 1rem !important;
    }
    
    /* LEADERSHIP - MOBILE */
    .w-48 {
        width: 9rem !important;
        height: 9rem !important;
    }
    
    /* FIX FOR LEADERSHIP IMAGES TO FILL CIRCLE */
    #leadership .rounded-full img {
        height: 100% !important;
        object-fit: cover !important;
    }
    
    /* CONTACT SECTION - MOBILE */
    input, textarea {
        font-size: 16px !important;
        padding: 0.875rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    button[type="submit"] {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
    }
    
    /* FOOTER - MOBILE */
    footer .grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center !important;
    }
    
    footer .flex.space-x-4 {
        justify-content: center !important;
    }
    
    footer h4 {
        font-size: 1.125rem !important;
    }
    
    footer ul {
        padding-left: 0 !important;
    }
    
    /* ANIMATIONS - DISABLE ON MOBILE FOR PERFORMANCE */
    .particle {
        display: none !important;
    }
    
    .animate-bounce {
        animation: none !important;
    }
    
    /* REMOVED: * { animation-duration: 0.2s !important; } to fix hero section speed */
    
    /* MOBILE MENU FIX */
    #mobile-menu {
        transform: translateX(100%) !important;
        transition: transform 0.3s ease-in-out !important;
    }
    
    #mobile-menu.open {
        transform: translateX(0) !important;
    }
    
    /* PREVENT HORIZONTAL SCROLL */
    .overflow-hidden {
        overflow-x: hidden !important;
    }
    
    /* ENSURE IMAGES DON'T OVERFLOW */
    img {
        max-width: 100% !important;
        /* height: auto !important; REMOVED/OVERRIDDEN by specific leadership rule above */
    }
    
    /* MOBILE PADDING FIXES */
    .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .px-8 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    .py-20 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* BETTER TOUCH TARGETS */
    a, button {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    /* SPACING IMPROVEMENTS */
    .mb-16 {
        margin-bottom: 2rem !important;
    }
    
    .mb-12 {
        margin-bottom: 1.5rem !important;
    }
    
    .mb-8 {
        margin-bottom: 1rem !important;
    }
    
    .mb-6 {
        margin-bottom: 0.75rem !important;
    }
    
    .gap-8 {
        gap: 1rem !important;
    }
}

/* EXTRA SMALL SCREENS */
@media screen and (max-width: 480px) {
    nav img {
        height: 1.75rem !important;
    }
    
    nav h1 {
        font-size: 0.7rem !important;
    }
    
    header h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    .glass-card {
        padding: 1rem !important;
    }
    
    .counter {
        font-size: 2rem !important;
    }
    
    .w-48 {
        width: 7rem !important;
        height: 7rem !important;
    }
    
    footer .grid {
        gap: 1.5rem !important;
    }
}

/* LANDSCAPE MOBILE */
@media screen and (max-width: 768px) and (orientation: landscape) {
    header {
        min-height: 100vh !important;
        padding: 1rem !important;
    }
    
    header h1 {
        font-size: 1.5rem !important;
    }
    
    #gallery .relative {
        height: 60vh !important;
    }
}
