/* ===================================
   MOBILE RESPONSIVENESS FIXES
   Mobile-First Approach
   =================================== */

/* Base Mobile Styles (320px and up) */
@media (max-width: 767px) {
    /* Hero Section - Fix cramped text */
    .hero {
        padding-top: var(--space-12); /* Reduce from 128px to 96px */
        padding-bottom: var(--space-8); /* Reduce from 96px to 64px */
    }
    
    h1 {
        font-size: 28px !important; /* Down from 40px */
        line-height: 1.3 !important; /* More breathing room */
        letter-spacing: -0.01em !important;
        padding: 0 var(--space-2); /* Add horizontal padding */
        word-wrap: break-word;
        hyphens: auto;
    }
    
    h2 {
        font-size: 16px !important;
        line-height: 1.5 !important;
        padding: 0 var(--space-2);
        margin-bottom: var(--space-4);
    }
    
    h3 {
        font-size: 24px !important; /* Down from 32px */
        line-height: 1.3 !important;
        margin-bottom: var(--space-3);
    }
    
    /* Container - Better mobile padding */
    .container {
        padding: 0 var(--space-2); /* 16px instead of 24px */
    }
    
    /* CTA Form - Better mobile layout */
    .cta-form {
        gap: var(--space-2);
        max-width: 100%;
    }
    
    .cta-button {
        font-size: 16px !important;
        padding: 14px 24px !important;
        height: 48px !important; /* Reduce from 52px */
        white-space: nowrap !important; /* Prevent wrapping with shorter text */
        line-height: 1.2 !important;
    }
    
    /* Show mobile text, hide desktop text on mobile */
    .mobile-text {
        display: inline !important;
    }
    
    .desktop-text {
        display: none !important;
    }
    
    .email-input {
        font-size: 16px !important; /* Prevent iOS zoom */
        height: 48px !important;
        padding: 12px 16px !important;
    }
    
    /* Trust heading - smaller on mobile */
    .trust-heading {
        font-size: 12px !important;
        line-height: 1.4;
        padding: 0 var(--space-2);
        margin-top: var(--space-3) !important; /* Add 24px gap above trust text */
    }
}

/* Small Mobile (320px - 374px) */
@media (max-width: 374px) {
    h1 {
        font-size: 24px !important;
        margin-bottom: var(--space-2);
    }
    
    .cta-button {
        font-size: 13px !important;
        padding: 12px 16px !important;
    }
    
    /* Hide less important text on very small screens */
    .trust-heading {
        font-size: 11px !important;
    }
}

/* Standard Mobile (375px - 413px) */
@media (min-width: 375px) and (max-width: 413px) {
    h1 {
        font-size: 26px !important;
    }
}

/* Large Mobile (414px - 767px) */
@media (min-width: 414px) and (max-width: 767px) {
    h1 {
        font-size: 30px !important;
    }
    
    .container {
        padding: 0 var(--space-3); /* Slightly more padding */
    }
}

/* Video Section Mobile Fixes */
@media (max-width: 767px) {
    /* Reduce padding between hero and video sections */
    .use-cases {
        padding-top: var(--space-8) !important; /* Reduce from 128px to 64px */
        padding-bottom: var(--space-8) !important;
    }
    
    .video-grid {
        grid-template-columns: 1fr !important; /* Single column */
        gap: var(--space-3);
    }
    
    .video-container {
        aspect-ratio: 16/9;
        width: 100%;
    }
    
    .video-section-subtitle {
        font-size: 16px !important;
        padding: 0 var(--space-2);
        margin-bottom: var(--space-4);
    }
}

/* Command Cards Mobile Layout */
@media (max-width: 767px) {
    .command-grid {
        grid-template-columns: 1fr !important; /* Single column */
        gap: var(--space-2);
    }
    
    .command-card {
        padding: var(--space-2);
    }
    
    .command-icon {
        font-size: 36px !important; /* Smaller icons */
        margin-bottom: var(--space-1);
    }
    
    .command-example {
        font-size: 14px !important;
        line-height: 1.5;
    }
}

/* FAQ Mobile Improvements */
@media (max-width: 767px) {
    .faq-item {
        border-radius: 12px;
    }
    
    .faq-question {
        min-height: auto;
        padding: var(--space-3) var(--space-4);
        padding-right: calc(var(--space-4) + 40px);
    }
    
    .faq-question h4 {
        font-size: 16px !important;
        line-height: 1.4;
    }
    
    /* Hide toggle text on mobile */
    .faq-toggle {
        display: none !important;
    }
    
    /* Smaller icon on mobile */
    .faq-question::after {
        width: 32px !important;
        height: 32px !important;
        right: var(--space-3);
    }
    
    .faq-question::before {
        width: 32px !important;
        height: 32px !important;
        right: var(--space-3);
        font-size: 20px !important;
    }
    
    .faq-answer {
        padding: 0 var(--space-3) !important;
    }
    
    .faq-answer ul {
        padding-left: var(--space-3);
    }
}

/* Section Padding Adjustments */
@media (max-width: 767px) {
    /* Reduce excessive padding between sections */
    .problem-solution {
        padding: var(--space-8) 0 !important; /* Reduce from 128px */
    }
    
    .social-proof {
        padding: var(--space-8) 0 !important; /* Reduce from 96px */
    }
    
    .use-cases-examples {
        padding: var(--space-8) 0 !important; /* Reduce from 96px */
    }
    
    .final-cta {
        padding: var(--space-8) 0 var(--space-6) 0 !important;
    }
}

/* How It Works Mobile */
@media (max-width: 767px) {
    .how-it-works-step {
        padding: var(--space-3);
        gap: var(--space-2);
    }
    
    .step-number {
        width: 36px !important;
        height: 36px !important;
    }
    
    .step-number span {
        font-size: 16px !important;
    }
    
    .step-content h4 {
        font-size: 18px !important;
    }
    
    .step-content p {
        font-size: 14px !important;
    }
}

/* Comparison Grid Mobile */
@media (max-width: 767px) {
    .comparison-grid {
        grid-template-columns: 1fr !important;
        gap: var(--space-2);
    }
    
    .comparison-column {
        padding: var(--space-3);
    }
    
    .comparison-column h4 {
        font-size: 18px !important;
        margin-bottom: var(--space-2);
    }
}

/* Demo Section Mobile */
@media (max-width: 767px) {
    .demo-window {
        padding: var(--space-2);
    }
    
    .demo-url,
    .demo-command {
        font-size: 16px !important; /* Prevent zoom */
        padding: 10px 14px;
    }
    
    .demo-button {
        font-size: 14px !important;
        padding: 12px 20px !important;
        height: 44px !important;
    }
    
    #demoHint {
        font-size: 12px !important;
        line-height: 1.4;
        padding: 0 var(--space-1);
    }
}

/* Final CTA Mobile */
@media (max-width: 767px) {
    .final-cta {
        padding: var(--space-8) 0 var(--space-6) 0;
    }
    
    .cta-subtitle {
        font-size: 16px !important;
        line-height: 1.5;
        padding: 0 var(--space-2);
        margin-bottom: var(--space-4);
    }
    
    .cta-form-vertical {
        padding: 0 var(--space-2);
    }
}

/* Modal Mobile Fixes */
@media (max-width: 767px) {
    .modal-content {
        padding: var(--space-4);
        width: 95%;
        max-width: 100%;
    }
    
    .modal-icon {
        width: 60px;
        height: 60px;
        margin-bottom: var(--space-3);
    }
    
    .modal-title {
        font-size: 22px !important;
    }
    
    .modal-message {
        font-size: 16px !important;
    }
    
    .modal-submessage {
        font-size: 14px !important;
    }
}

/* Touch Target Improvements */
@media (max-width: 767px) {
    /* Ensure all interactive elements meet 44px minimum */
    button,
    input,
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better tap spacing */
    .ph-badge-link {
        padding: 8px;
        margin: -8px;
    }
}

/* Landscape Mobile Adjustments */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding-top: var(--space-8);
        padding-bottom: var(--space-6);
    }
    
    h1 {
        font-size: 24px !important;
        margin-bottom: var(--space-2);
    }
    
    .modal-content {
        padding: var(--space-3);
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Accessibility - Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .faq-question,
    .command-card,
    .comparison-column,
    .demo-window {
        border-width: 2px;
    }
}