/* ==========================================
   MOBILE RESPONSIVE ENHANCEMENTS
   Swarna Hospital - Mobile-First Design
   ========================================== */

/* Mobile-First Base Styles */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* WhatsApp / FAB buttons: above home indicator on iOS */
a.fixed.z-50[href*="wa.me"] {
    right: calc(1.5rem + env(safe-area-inset-right));
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
}
a.fixed.z-50[href^="tel:"] {
    left: calc(1.5rem + env(safe-area-inset-left));
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

/* Enhanced Mobile Navigation */
.sticky-nav {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-top: env(safe-area-inset-top);
}

.sticky-nav .container {
    padding: 0.75rem 1rem;
}

/* Mobile Menu Improvements */
#mobileMenu {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(49, 46, 129, 0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobileMenu a {
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    margin: 0.25rem 1rem;
    transition: all 0.2s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

#mobileMenu a:hover,
#mobileMenu a:focus {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

/* Mobile Menu Toggle Button */
#mobileMenuToggle {
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mobileMenuToggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

#mobileMenuToggle:focus {
    outline: 2px solid #06b6d4;
    outline-offset: 2px;
}

/* Logo Responsive Adjustments */
.sticky-nav img {
    width: 3rem;
    height: 3rem;
}

.sticky-nav h1 {
    font-size: 1.25rem;
    line-height: 1.2;
}

.sticky-nav p {
    font-size: 0.75rem;
}

/* Hero Section Mobile Optimization */
.premium-gradient {
    min-height: 100vh;
    padding-top: 5rem;
}

.hero-content h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Button Improvements for Mobile */
.btn,
button,
a[class*="btn"] {
    min-height: 48px;
    min-width: 48px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn:active,
button:active {
    transform: scale(0.98);
}

/* Form Enhancements for Mobile */
input,
textarea,
select {
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

input.error,
textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Card Responsive Improvements */
.card,
.glass-card,
.service-card,
.doctor-card {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.card:hover,
.glass-card:hover {
    transform: translateY(-4px);
}

/* Image Optimization for Mobile */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.hero-image img,
.doctor-image {
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Grid Responsive Improvements */
.grid {
    display: grid;
    gap: 1.5rem;
}

.services-grid,
.doctors-grid {
    grid-template-columns: 1fr;
}

/* Stats Section Mobile */
.stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
}

/* Section Spacing for Mobile */
section {
    padding: 3rem 1rem;
}

.section-header {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Floating Elements Mobile Adjustments */
.hero-floating-card {
    display: none; /* Hide on mobile for cleaner look */
}

/* Animation Performance Optimization */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    .card:hover,
    .btn:hover {
        transform: none;
    }
    
    .card:active,
    .btn:active {
        transform: scale(0.98);
    }
}

/* ==========================================
   TABLET RESPONSIVE (768px - 1024px)
   ========================================== */

@media (min-width: 768px) {
    .sticky-nav .container {
        padding: 1rem 1.5rem;
    }
    
    .sticky-nav img {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    .sticky-nav h1 {
        font-size: 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.125rem;
    }
    
    .services-grid,
    .doctors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    section {
        padding: 4rem 1.5rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .section-subtitle {
        font-size: 1.125rem;
    }
}

/* ==========================================
   DESKTOP RESPONSIVE (1024px+)
   ========================================== */

@media (min-width: 1024px) {
    .sticky-nav .container {
        padding: 1rem 2rem;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .hero-content p {
        font-size: 1.25rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .doctors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    section {
        padding: 6rem 2rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
    
    .section-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-floating-card {
        display: flex; /* Show floating cards on desktop */
    }
}

/* ==========================================
   LARGE DESKTOP (1280px+)
   ========================================== */

@media (min-width: 1280px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .doctors-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================== */

/* Focus Indicators */
*:focus {
    outline: 2px solid #06b6d4;
    outline-offset: 2px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
}

.skip-link:focus {
    top: 6px;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn,
    .card {
        border: 2px solid currentColor;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --card-bg: #2a2a2a;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .card {
        background-color: var(--card-bg);
    }
}

/* ==========================================
   PERFORMANCE OPTIMIZATIONS
   ========================================== */

/* GPU Acceleration for Animations */
.card,
.btn,
.hero-floating-card {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimize Images */
img {
    loading: lazy;
    decoding: async;
}

/* Reduce Layout Shifts */
.hero-image,
.doctor-image {
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* Equipment page & carousel: responsive heights for tab, mobile, desktop */
.equipment-carousel .carousel-slides {
    min-height: 220px;
}

.equipment-carousel .carousel-slide img {
    object-fit: cover;
    -webkit-object-fit: cover;
    width: 100%;
    height: 100%;
}

@media (min-width: 768px) {
    .equipment-carousel .carousel-slides {
        min-height: 280px;
    }
}

@media (min-width: 1024px) {
    .equipment-carousel .carousel-slides {
        min-height: 384px;
    }
}

/* Prevent horizontal scroll on equipment grid */
.section-padding .container {
    overflow-x: hidden;
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    .sticky-nav,
    #mobileMenu,
    .hero-floating-card,
    .btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .section-title {
        font-size: 18pt;
        margin-bottom: 12pt;
    }
    
    .card {
        break-inside: avoid;
        margin-bottom: 12pt;
    }
}