/* Mobile-optimized styles for rider registration forms */

/* Base mobile improvements */
@media (max-width: 768px) {
    /* Container adjustments */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Form spacing */
    .space-y-8 > * + * {
        margin-top: 1.5rem;
    }
    
    .space-y-6 > * + * {
        margin-top: 1rem;
    }
    
    /* Input field improvements */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 1rem !important;
        line-height: 1.5;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    /* Touch-friendly buttons */
    button {
        min-height: 44px; /* iOS recommended touch target */
        font-size: 16px;
        padding: 1rem 1.5rem;
    }
    
    /* File upload areas - larger touch targets */
    .border-dashed {
        min-height: 120px;
        padding: 1.5rem !important;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    .border-dashed:active {
        background-color: rgba(34, 197, 94, 0.05);
        border-color: #22c55e;
    }
    
    /* Radio buttons and checkboxes - larger touch targets */
    input[type="radio"],
    input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 0.75rem;
    }
    
    /* Select dropdown improvements */
    select {
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
        background-position: right 0.75rem center;
        background-repeat: no-repeat;
        background-size: 1.25rem;
        padding-right: 3rem;
    }
    
    /* Step progress improvements */
    .step-progress {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .step-progress .step {
        min-width: 40px;
        min-height: 40px;
        font-size: 14px;
    }
    
    /* Navigation button improvements */
    .navigation-buttons {
        gap: 1rem;
        padding-top: 1.5rem;
    }
    
    .navigation-buttons button {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
        font-size: 16px;
        font-weight: 600;
    }
    
    /* Grid layout adjustments */
    .grid-cols-1 {
        gap: 1.5rem;
    }
    
    /* Card spacing */
    .rounded-xl {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem;
    }
    
    /* Typography adjustments */
    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    h4 {
        font-size: 1.125rem;
        line-height: 1.4;
    }
    
    /* Label improvements */
    label {
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    /* Error message styling */
    .text-red-600 {
        font-size: 14px;
        margin-top: 0.5rem;
    }
    
    /* Phone number input special handling */
    .phone-input-container {
        display: flex;
        align-items: stretch;
    }
    
    .phone-input-container .country-code {
        padding: 1rem 0.75rem;
        font-size: 14px;
        background-color: #f9fafb;
        border: 1px solid #d1d5db;
        border-right: none;
        border-radius: 0.5rem 0 0 0.5rem;
        display: flex;
        align-items: center;
        min-width: 80px;
    }
    
    .phone-input-container input {
        border-radius: 0 0.5rem 0.5rem 0;
        border-left: none;
        flex: 1;
    }
    
    /* Upload success feedback */
    .upload-success {
        padding: 1rem;
        text-align: center;
    }
    
    .upload-success svg {
        width: 2rem;
        height: 2rem;
        margin: 0 auto 0.5rem;
    }
    
    /* Loading states */
    .btn-loading {
        pointer-events: none;
        opacity: 0.7;
    }
    
    /* Focus improvements */
    input:focus,
    select:focus,
    textarea:focus {
        outline: none;
        border-color: #22c55e;
        box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    }
    
    /* Accessibility improvements */
    .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;
    }
    
    /* Animation improvements for mobile */
    .animate__animated {
        animation-duration: 0.3s;
    }
    
    /* Reduce motion for users who prefer it */
    @media (prefers-reduced-motion: reduce) {
        .animate__animated,
        .transition-all,
        .hover\\:scale-105 {
            animation: none !important;
            transition: none !important;
            transform: none !important;
        }
    }
    
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .rounded-xl {
        padding: 1rem !important;
        border-radius: 0.75rem;
    }
    
    /* Smaller spacing for very small screens */
    .space-y-8 > * + * {
        margin-top: 1rem;
    }
    
    .navigation-buttons button {
        padding: 0.875rem 1.5rem;
        font-size: 15px;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .space-y-8 > * + * {
        margin-top: 1rem;
    }
    
    .rounded-xl {
        padding: 1rem !important;
    }
    
    h2 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .border-dashed {
        border-width: 1px;
    }
}

/* Touch-specific improvements */
@media (pointer: coarse) {
    /* Larger touch targets for touch devices */
    button,
    input[type="radio"],
    input[type="checkbox"],
    .border-dashed {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .hover\\:scale-105:hover {
        transform: none;
    }
    
    .hover\\:shadow-lg:hover {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }
}

/* Custom scrollbar for mobile */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari input zoom prevention */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* iOS Safari button styling */
    button {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        border-radius: 0.5rem;
    }
    
    /* iOS Safari select styling */
    select {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    }
}
