/* ========================================
   WHOMAILS - MOBILE RESPONSIVE STYLES
   ======================================== */

/* Optimisations globales pour mobile */
@media (max-width: 1024px) {
    /* Empêcher le zoom automatique sur les inputs iOS */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Améliorer les zones tactiles */
    a, button, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Réduire les marges excessives */
    .py-24 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .py-20 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
}

/* Tablettes et petits desktops */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Navigation adaptée aux tablettes */
    nav .hidden.lg\\:flex {
        display: flex !important;
    }
    
    .lg\\:hidden {
        display: none !important;
    }
}

/* Tablettes en portrait */
@media (max-width: 768px) {
    /* Titres plus petits */
    h1, .text-4xl, .text-5xl, .text-6xl {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    h2, .text-3xl {
        font-size: 1.75rem !important;
    }
    
    h3, .text-2xl {
        font-size: 1.5rem !important;
    }
    
    /* Padding réduit sur containers */
    .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .py-12 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Grids en colonnes simples */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
    
    .md\\:grid-cols-2,
    .md\\:grid-cols-3,
    .lg\\:grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
    
    /* Flex direction en colonne */
    .sm\\:flex-row {
        flex-direction: column !important;
    }
    
    /* Spacing réduit */
    .space-x-8 > * + *,
    .space-x-6 > * + *,
    .space-x-4 > * + * {
        margin-left: 0 !important;
        margin-top: 0.5rem !important;
    }
    
    /* Cards full width */
    .max-w-4xl,
    .max-w-3xl,
    .max-w-2xl {
        max-width: 100% !important;
    }
    
    /* Boutons full width sur mobile */
    .inline-flex {
        width: 100%;
        justify-content: center;
    }
    
    /* Stats et feature cards */
    .stat-card,
    .feature-card {
        margin-bottom: 1rem;
    }
    
    /* Formulaires responsive */
    .auth-form,
    .search-form {
        padding: 1.5rem !important;
    }
    
    /* Navigation mobile améliorée */
    #mobile-menu {
        background: white;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    
    #mobile-menu a {
        padding: 0.75rem 1rem;
        display: block;
        border-radius: 0.5rem;
        margin: 0.25rem 0;
    }
}

/* Smartphones */
@media (max-width: 640px) {
    /* Tout en full width */
    body {
        overflow-x: hidden;
    }
    
    /* Containers sans padding horizontal excessif */
    .container,
    .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Titres encore plus petits */
    h1 {
        font-size: 1.75rem !important;
    }
    
    /* Images responsive */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Tables scrollables */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Modals full screen sur mobile */
    .modal-container {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    
    /* Footer responsive */
    footer {
        padding: 2rem 1rem !important;
    }
    
    footer .grid-cols-4,
    footer .md\\:grid-cols-2,
    footer .lg\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Hero section mobile */
    .hero-section {
        padding: 2rem 1rem !important;
        min-height: auto !important;
    }
    
    /* CTA buttons full width */
    .cta-button,
    .btn-primary,
    .btn-secondary {
        width: 100% !important;
        margin: 0.5rem 0 !important;
    }
    
    /* Search input mobile */
    #domainInput,
    .search-input {
        font-size: 16px !important;
        padding: 1rem !important;
    }
    
    /* Results section mobile */
    #resultsContainer {
        padding: 1rem !important;
    }
    
    /* Tab navigation mobile */
    .tab-button {
        font-size: 0.875rem !important;
        padding: 0.75rem 1rem !important;
    }
    
    /* Chrome extension banner mobile */
    #chromeExtensionBanner {
        padding: 0.75rem !important;
    }
    
    #chromeExtensionBanner .flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }
    
    #chromeExtensionBanner button,
    #chromeExtensionBanner a {
        width: 100% !important;
        text-align: center !important;
    }
}

/* Très petits smartphones */
@media (max-width: 375px) {
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    .text-base {
        font-size: 0.875rem !important;
    }
    
    /* Padding minimal */
    .px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}

/* Landscape mode pour smartphones */
@media (max-width: 896px) and (orientation: landscape) {
    /* Réduire les hauteurs en landscape */
    .min-h-screen {
        min-height: auto !important;
    }
    
    /* Modals adaptés au landscape */
    .modal-container {
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
    
    /* Hero plus compact en landscape */
    .hero-section,
    .pt-24 {
        padding-top: 1rem !important;
    }
}

/* Fix pour iOS */
@supports (-webkit-touch-callout: none) {
    /* Empêcher le double-tap zoom */
    button, a {
        touch-action: manipulation;
    }
    
    /* Fix pour les inputs qui provoquent du zoom */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Safe area pour les notchs */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Fix pour Android */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select {
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 0.5rem center;
        background-size: 1.5em 1.5em;
        padding-right: 2.5rem;
    }
}

/* Animations optimisées pour mobile */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support pour mobile */
@media (prefers-color-scheme: dark) {
    /* À implémenter si nécessaire */
}

/* Accessibilité touch */
@media (pointer: coarse) {
    /* Zones tactiles plus grandes */
    button,
    a,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Padding augmenté pour les éléments cliquables */
    .clickable {
        padding: 0.75rem 1rem;
    }
}

/* Print styles pour mobile */
@media print {
    #mobile-menu,
    #chromeExtensionBanner,
    .modal-overlay,
    nav button {
        display: none !important;
    }
}
