/* Resume Builder Mobile Optimizations */

/* Ensure touch-friendly interfaces */
@media (max-width: 768px) {
    .voice-button {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .form-step {
        padding: 1rem;
    }
    
    .step-indicator {
        display: none;
    }
    
    .step-indicator.active {
        display: flex;
    }
    
    /* Stack form elements vertically on mobile */
    .grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .grid-cols-2.md\\:grid-cols-3 {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    /* Larger text areas on mobile */
    textarea {
        min-height: 120px;
    }
    
    /* Better checkbox spacing */
    input[type="checkbox"] + span {
        font-size: 0.875rem;
        line-height: 1.25;
    }
    
    /* Resume preview adjustments */
    .resume-preview {
        font-size: 10pt;
        padding: 0.75rem;
        margin: 0;
    }
    
    /* Voice modal improvements */
    #voiceModal .bg-white {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    /* Progress bar container */
    .step-indicator {
        font-size: 0.75rem;
    }
    
    .step-number {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.875rem;
    }
    
    /* Form navigation buttons */
    .next-step,
    .prev-step {
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .flex.justify-between {
        flex-direction: column;
    }
    
    .flex.justify-between .prev-step {
        order: 2;
        background-color: #f3f4f6;
        color: #374151;
    }
    
    .flex.justify-between .next-step {
        order: 1;
        margin-bottom: 1rem;
    }
    
    /* Download section improvements */
    .lg\\:w-80 {
        width: 100%;
        margin-top: 2rem;
    }
    
    .flex-col.lg\\:flex-row {
        flex-direction: column;
    }
    
    /* Improved loading states */
    .ai-thinking {
        font-size: 0.875rem;
        padding: 0.5rem;
        background: #f0f9ff;
        border-radius: 0.5rem;
        border-left: 3px solid #3b82f6;
    }
    
    /* Better voice input feedback */
    .voice-input-container .voice-button {
        right: 0.5rem;
    }
    
    /* Improve form field focus states */
    input:focus,
    textarea:focus,
    select:focus {
        outline: 2px solid #3b82f6;
        outline-offset: 2px;
        border-color: #3b82f6;
    }
    
    /* Better error states */
    .border-red-500 {
        border-color: #ef4444 !important;
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
    }
}

/* Voice recording animations for mobile */
@media (max-width: 768px) {
    .voice-button.recording {
        animation: pulse-mobile 1.5s ease-in-out infinite;
    }
    
    @keyframes pulse-mobile {
        0%, 100% {
            transform: scale(1);
            box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
        }
        50% {
            transform: scale(1.05);
            box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
        }
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .voice-button.recording,
    .thinking-dot,
    .wave-bar,
    .wave-bar-large {
        animation: none;
    }
    
    .voice-button.recording {
        background: #ef4444;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .voice-button {
        border: 2px solid currentColor;
    }
    
    .voice-button.recording {
        border-color: #ffffff;
    }
    
    .form-step {
        border: 1px solid #374151;
    }
}

/* Print styles for resume preview */
@media print {
    .resume-preview {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0.5in;
        font-size: 11pt;
        box-shadow: none;
    }
    
    /* Hide everything except resume preview */
    body > *:not(.resume-preview) {
        display: none !important;
    }
    
    .resume-preview {
        display: block !important;
    }
}

/* Focus management for better accessibility */
.form-step:not(.active) {
    display: none;
}

.form-step.active {
    display: block;
}

/* Improve voice modal on very small screens */
@media (max-width: 480px) {
    #voiceModal .bg-white {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .voice-wave-large {
        height: 20px;
    }
    
    .wave-bar-large {
        width: 2px;
    }
}

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .resume-preview {
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .form-step {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* Safe area adjustments for mobile devices with notches */
@media (max-width: 768px) {
    .max-w-4xl {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Improved typography for mobile */
@media (max-width: 768px) {
    h1 {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 2rem;
    }
    
    .text-lg {
        font-size: 1rem;
        line-height: 1.5rem;
    }
}
