/**
 * Mobile-first responsive enhancements
 * Ensures optimal mobile experience across all devices
 */

/* Email reveal reCAPTCHA styling */
.email-reveal-container {
    display: inline-block;
}

.email-reveal-container .g-recaptcha {
    transform: scale(0.9);
    transform-origin: left center;
}

@media (max-width: 480px) {
    .email-reveal-container .g-recaptcha {
        transform: scale(0.8);
    }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
    /* Increase touch targets */
    button, a, input, textarea, select {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    /* Improve form usability */
    input[type="text"], 
    input[type="email"], 
    input[type="tel"], 
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
        border: 2px solid #e5e7eb;
        transition: border-color 0.3s ease;
    }
    
    input:focus, textarea:focus {
        outline: none;
        border-color: #6B46C1;
        box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
    }
    
    /* Better mobile navigation */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 40;
        backdrop-filter: blur(4px);
    }
    
    .mobile-menu {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        background: white;
        z-index: 50;
        transition: right 0.3s ease;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu.open {
        right: 0;
    }
    
    /* Improved card layouts */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Better spacing for mobile */
    .mobile-padding {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Optimized text sizes */
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    .section-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    /* Mobile-optimized animations */
    .mobile-reduce-motion {
        animation-duration: 0.3s !important;
        animation-iteration-count: 1 !important;
    }
    
    /* Improve CTA buttons */
    .cta-button {
        width: 100%;
        margin-bottom: 1rem;
        font-size: 1.125rem;
        font-weight: 600;
    }
    
    /* Better image handling */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Scroll behaviour improvements */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better table responsiveness */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
}

/* Small mobile devices (iPhone SE, etc.) */
@media (max-width: 375px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    /* Even more compact spacing */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    /* Reduce hero height in landscape */
    .hero-section {
        min-height: 70vh;
    }
    
    /* Compact navigation */
    .navbar {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders and shadows */
    .card, .button {
        border-width: 0.5px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .auto-dark {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .auto-dark input, .auto-dark textarea {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .button, .link {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid #000;
    }
}

/* Focus improvements for keyboard navigation */
.focus-visible:focus {
    outline: 2px solid #6B46C1;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-block {
        display: block !important;
    }
    
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
    }
}