/* ===== MOBILE-FIRST ENHANCEMENTS FOR DR. ANURADHA'S CLINIC ===== */
/* Bootstrap-powered mobile optimizations */

/* ===== CORE MOBILE OPTIMIZATIONS ===== */
:root {
    --mobile-touch-target: 48px; /* Minimum touch target size */
    --mobile-spacing: 1rem;
    --mobile-font-base: 16px; /* Prevent iOS zoom */
}

/* Ensure all inputs are at least 16px to prevent zoom on iOS */
input, select, textarea {
    font-size: 16px !important;
}

/* Enhanced touch targets for mobile */
.btn, .nav-link, .action-btn, .whatsapp-btn {
    min-height: var(--mobile-touch-target);
    min-width: var(--mobile-touch-target);
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ===== HERO STATS MOBILE ENHANCEMENTS ===== */
@media (max-width: 575.98px) {
    /* Mobile hero stats improvements */
    .hero-stats .stat {
        padding: 1.5rem 1rem !important;
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border: 2px solid rgba(255, 192, 203, 0.2);
        transition: all 0.3s ease;
    }
    
    .hero-stats .stat:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
        border-color: rgba(255, 192, 203, 0.4);
    }
    
    .hero-stats .stat-number {
        font-size: 2.5rem !important;
        margin-bottom: 0.5rem;
        font-weight: 700 !important;
    }
    
    .hero-stats .stat-label {
        font-size: 0.9rem !important;
        font-weight: 600;
        line-height: 1.2;
        color: #6c757d;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    /* Small tablet adjustments */
    .hero-stats .stat {
        padding: 1.25rem 0.75rem !important;
        min-height: 110px;
    }
    
    .hero-stats .stat-number {
        font-size: 2.25rem !important;
    }
    
    .hero-stats .stat-label {
        font-size: 0.85rem !important;
        font-weight: 600;
    }
}

/* ===== MOBILE NAVIGATION IMPROVEMENTS ===== */
@media (max-width: 991.98px) {
    /* Better mobile navigation */
    .navbar-nav {
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-item {
        margin-bottom: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        font-weight: 500;
        border-radius: 8px;
        margin: 0 1rem;
        text-align: center;
        background: rgba(255, 192, 203, 0.1);
        margin-bottom: 0.5rem;
        transition: all 0.3s ease;
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        background: var(--primary-color);
        color: white;
        transform: scale(1.02);
    }
    
    /* Improved hamburger button */
    .navbar-toggler {
        border: none;
        padding: 8px 12px;
        border-radius: 8px;
        background: rgba(255, 192, 203, 0.1);
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(255, 192, 203, 0.3);
    }
}

/* ===== HERO SECTION MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    .hero {
        min-height: 90vh;
        display: flex;
        align-items: center;
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 4vw, 1.2rem);
        line-height: 1.5;
        margin-bottom: 2rem;
    }
    
    .hero-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .stat {
        padding: 1rem;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .stat-number {
        font-size: clamp(1.2rem, 6vw, 2rem);
        font-weight: 700;
        color: var(--primary-color);
        display: block;
    }
    
    .stat-label {
        font-size: clamp(0.7rem, 3vw, 0.9rem);
        color: var(--text-color);
        margin-top: 0.5rem;
    }
    
    /* Mobile-optimized buttons */
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1.1rem;
        font-weight: 600;
        border-radius: 50px;
        min-height: 56px;
    }
}

/* ===== SERVICES SECTION MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    .services-tabs .tab-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .tab-btn {
        width: 100%;
        padding: 1.2rem 1rem;
        font-size: 1.1rem;
        font-weight: 600;
        border-radius: 12px;
        border: 2px solid var(--primary-color);
        background: white;
        color: var(--primary-color);
        transition: all 0.3s ease;
        min-height: 60px;
    }
    
    .tab-btn.active,
    .tab-btn:hover {
        background: var(--primary-color);
        color: white;
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(255, 105, 180, 0.3);
    }
    
    .services-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
        background: white;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        border: 1px solid rgba(255, 192, 203, 0.2);
    }
    
    .service-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    }
    
    .service-icon {
        font-size: 3rem;
        color: var(--primary-color);
        margin-bottom: 1rem;
    }
    
    .service-card h4 {
        font-size: 1.3rem;
        font-weight: 600;
        margin-bottom: 1rem;
        color: var(--dark-text);
    }
    
    .service-card p {
        font-size: 1rem;
        line-height: 1.6;
        color: var(--text-color);
        margin-bottom: 1.5rem;
    }
    
    .service-features {
        list-style: none;
        padding: 0;
    }
    
    .service-features li {
        padding: 0.5rem 0;
        font-size: 0.95rem;
        color: var(--text-color);
        position: relative;
        padding-left: 1.5rem;
    }
    
    .service-features li:before {
        content: '✓';
        position: absolute;
        left: 0;
        color: var(--primary-color);
        font-weight: bold;
    }
}

/* ===== CONTACT FORM MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    .contact-form-container {
        padding: 2rem 1.5rem;
        background: white;
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
        margin-top: 2rem;
    }
    
    .contact-form h3 {
        font-size: 1.5rem;
        font-weight: 600;
        margin-bottom: 2rem;
        text-align: center;
        color: var(--dark-text);
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-group label {
        font-size: 1rem;
        font-weight: 500;
        color: var(--dark-text);
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 1rem 1.2rem;
        font-size: 16px; /* Prevent zoom on iOS */
        border: 2px solid #e1e5e9;
        border-radius: 12px;
        background: #f8f9fa;
        transition: all 0.3s ease;
        min-height: var(--mobile-touch-target);
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        outline: none;
        border-color: var(--primary-color);
        background: white;
        box-shadow: 0 0 0 4px rgba(255, 105, 180, 0.1);
    }
    
    .form-submit {
        width: 100%;
        padding: 1.2rem 2rem;
        font-size: 1.1rem;
        font-weight: 600;
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: 50px;
        min-height: 56px;
        transition: all 0.3s ease;
    }
    
    .form-submit:hover {
        background: var(--primary-hover);
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(255, 105, 180, 0.3);
    }
    
    .form-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ===== QUICK ACTION BUTTONS MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    .quick-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .action-btn {
        width: 100%;
        padding: 1.2rem 2rem;
        font-size: 1.1rem;
        font-weight: 600;
        border-radius: 50px;
        text-decoration: none;
        transition: all 0.3s ease;
        min-height: 56px;
        text-align: center;
    }
    
    .action-btn.whatsapp {
        background: #25d366;
        color: white;
        border: none;
    }
    
    .action-btn.whatsapp:hover {
        background: #1db554;
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(37, 211, 102, 0.3);
        color: white;
    }
    
    .action-btn.maps {
        background: #4285f4;
        color: white;
        border: none;
    }
    
    .action-btn.maps:hover {
        background: #3367d6;
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(66, 133, 244, 0.3);
        color: white;
    }
}

/* ===== TESTIMONIALS MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    .testimonial-card {
        padding: 2rem 1.5rem;
        background: white;
        border-radius: 16px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
        margin-bottom: 1.5rem;
        border: 1px solid rgba(255, 192, 203, 0.2);
    }
    
    .testimonial-text {
        font-size: 1rem;
        line-height: 1.6;
        color: var(--text-color);
        margin-bottom: 1.5rem;
        font-style: italic;
    }
    
    .testimonial-rating {
        margin-bottom: 1rem;
    }
    
    .testimonial-rating i {
        color: #ffd700;
        font-size: 1.2rem;
        margin-right: 0.2rem;
    }
    
    .testimonial-author h4 {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--dark-text);
        margin-bottom: 0.3rem;
    }
    
    .testimonial-author span {
        font-size: 0.9rem;
        color: var(--primary-color);
        font-weight: 500;
    }
}

/* ===== FLOATING WHATSAPP OPTIMIZATION ===== */
.floating-whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.floating-whatsapp a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.floating-whatsapp a:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(37, 211, 102, 0.5);
    color: white;
}

@keyframes pulse {
    0% {
        box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
    100% {
        box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (max-width: 768px) {
    /* Focus indicators for touch navigation */
    .btn:focus,
    .nav-link:focus,
    .action-btn:focus,
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    /* Skip to content link for screen readers */
    .skip-to-content {
        position: absolute;
        top: -40px;
        left: 6px;
        background: var(--primary-color);
        color: white;
        padding: 8px;
        text-decoration: none;
        border-radius: 4px;
        z-index: 1001;
        transition: top 0.3s;
    }
    
    .skip-to-content:focus {
        top: 6px;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    /* Reduce animations on slow connections */
    @media (prefers-reduced-data: reduce) {
        * {
            animation-duration: 0.1s !important;
            transition-duration: 0.1s !important;
        }
    }
    
    /* Optimize for touch */
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Allow text selection for content */
    p, h1, h2, h3, h4, h5, h6, span, div.testimonial-text {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
    
    /* Prevent text selection on interactive elements */
    button, .btn, .nav-link, .action-btn {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* ===== BETTER LOADING STATES ===== */
@media (max-width: 768px) {
    /* Loading skeleton for better perceived performance */
    .loading-skeleton {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }
    
    @keyframes loading {
        0% {
            background-position: 200% 0;
        }
        100% {
            background-position: -200% 0;
        }
    }
}

/* ===== RESPONSIVE IMAGES ===== */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
    }
    
    .doctor-image, .about-doctor-image {
        border-radius: 50%;
        object-fit: cover;
    }
}

/* ===== PRINT STYLES FOR MOBILE ===== */
@media print {
    .floating-whatsapp,
    .quick-actions,
    .hero-buttons {
        display: none !important;
    }
    
    body {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .container {
        padding: 0;
        max-width: none;
    }
}