/**
 * Mobile Responsive Styles - Docteur-ParleMoi
 * Optimized for iOS 6+, Android and all mobile devices
 */

/* Base Mobile Styles */
@media only screen and (max-width: 480px) {
    /* Header */
    .ins-header {
        padding: 0.75rem 1rem;
    }
    
    .ins-header-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .ins-logo-img {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .ins-logo-text {
        font-size: 1.1rem;
    }
    
    /* Container */
    .ins-container {
        margin: 1rem auto;
        padding: 0 0.75rem;
    }
    
    /* Progress Steps */
    .ins-progress {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .ins-progress::before {
        display: none;
    }
    
    .ins-progress-step {
        max-width: 70px;
    }
    
    .ins-step-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .ins-step-label {
        font-size: 0.65rem;
    }
    
    /* Card */
    .ins-card {
        border-radius: 15px;
    }
    
    .ins-card-header {
        padding: 1.25rem;
    }
    
    .ins-card-header h1 {
        font-size: 1.25rem;
    }
    
    .ins-card-header p {
        font-size: 0.85rem;
    }
    
    .ins-card-body {
        padding: 1.25rem;
    }
    
    /* Form */
    .ins-form-row {
        grid-template-columns: 1fr;
    }
    
    .ins-form-group {
        margin-bottom: 1rem;
    }
    
    .ins-form-group label {
        font-size: 0.9rem;
    }
    
    .ins-form-group input,
    .ins-form-group select,
    .ins-form-group textarea {
        padding: 0.7rem 0.9rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons */
    .ins-btn-group {
        flex-direction: column;
        gap: 0.75rem;
        padding-top: 1rem;
    }
    
    .ins-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
    
    /* Code Display */
    .ins-code-display {
        padding: 1rem;
    }
    
    .ins-generated-code {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }
    
    /* Notifications */
    .ins-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Links */
    .ins-links {
        font-size: 0.9rem;
    }
    
    /* Checkbox items */
    .ins-checkbox-item {
        padding: 0.75rem;
    }
    
    .ins-checkbox-item .item-title {
        font-size: 0.95rem;
    }
    
    .ins-checkbox-item .item-desc {
        font-size: 0.8rem;
    }
    
    /* Technical sections */
    .technical-section {
        padding: 1rem;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
    }
    
    /* Summary box */
    .summary-box {
        padding: 1rem;
    }
    
    /* Upload zones */
    .ins-upload-zone {
        padding: 1.25rem;
    }
    
    .ins-upload-zone i {
        font-size: 2rem;
    }
}

/* Tablet Styles */
@media only screen and (min-width: 481px) and (max-width: 768px) {
    .ins-header-content {
        padding: 0 0.5rem;
    }
    
    .ins-logo-text {
        font-size: 1.2rem;
    }
    
    .ins-container {
        margin: 1.5rem auto;
    }
    
    .ins-progress-step {
        max-width: 120px;
    }
    
    .ins-step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .ins-card-header {
        padding: 1.5rem;
    }
    
    .ins-card-header h1 {
        font-size: 1.5rem;
    }
    
    .ins-card-body {
        padding: 1.5rem;
    }
    
    .ins-form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .ins-btn-group {
        flex-wrap: wrap;
    }
    
    .ins-btn {
        flex: 1;
        min-width: 140px;
    }
}

/* Large Mobile / Small Tablet */
@media only screen and (min-width: 375px) and (max-width: 667px) {
    /* Improved touch targets */
    .ins-form-group input,
    .ins-form-group select,
    .ins-btn {
        min-height: 44px; /* iOS minimum touch target */
    }
    
    /* Larger checkboxes for touch */
    .ins-checkbox-item input[type="checkbox"],
    .ins-checkbox-item input[type="radio"] {
        width: 24px;
        height: 24px;
    }
    
    /* More spacing between form elements */
    .ins-form-group {
        margin-bottom: 1.25rem;
    }
    
    /* Larger progress indicators */
    .ins-step-number {
        width: 38px;
        height: 38px;
    }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS viewport issues */
    body {
        min-height: -webkit-fill-available;
    }
    
    /* iOS input zoom prevention */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
    }
    
    /* iOS tap highlight color */
    .ins-btn,
    .ins-checkbox-item,
    a {
        -webkit-tap-highlight-color: rgba(255, 107, 53, 0.2);
    }
    
    /* iOS smooth scrolling */
    html {
        -webkit-overflow-scrolling: touch;
    }
}

/* Android Specific Fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (max-width: 480px) {
    /* Fix for Android input issues */
    input:focus,
    select:focus,
    textarea:focus {
        font-size: 16px;
    }
    
    /* Android touch feedback */
    .ins-btn:active,
    .ins-checkbox-item:active {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

/* Landscape Mobile */
@media only screen and (max-width: 768px) and (orientation: landscape) {
    .ins-progress {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .ins-progress-step {
        max-width: 100px;
    }
    
    .ins-step-label {
        display: none;
    }
    
    .ins-card-body {
        padding: 1rem;
    }
    
    .ins-form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .ins-btn-group {
        flex-direction: row;
    }
}

/* Print styles */
@media print {
    .ins-header {
        position: static;
    }
    
    .ins-progress,
    .ins-btn-group {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ins-form-group input,
    .ins-form-group select {
        border-width: 3px;
    }
    
    .ins-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@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 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-dark: #1a1a2e;
        --text-light: #bdc3c7;
    }
    
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .ins-card {
        background: #2d2d44;
    }
    
    .ins-header {
        background: #2d2d44;
    }
    
    .ins-logo-text {
        color: #fff;
    }
    
    .ins-form-group input,
    .ins-form-group select,
    .ins-form-group textarea {
        background: #3d3d5c;
        border-color: #4d4d6c;
        color: #fff;
    }
    
    .ins-form-group label {
        color: #e0e0e0;
    }
}
