/**
 * Mobile Modal Design Fix
 * Optimized touch interactions and responsive layout for Get Started modal
 */

/* ========================================
   MOBILE MODAL OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
    /* Ensure modal overlay is properly positioned on mobile */
    .modal-overlay {
        padding: 0.5rem;
    }
    
    .modal-overlay.active {
        display: flex;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    /* Modal content - optimized for mobile */
    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 20px;
        max-height: calc(100vh - 4rem);
        margin: 0;
    }
    
    /* ===== GET STARTED MODAL - MOBILE ===== */
    
    /* Modal header - compact on mobile */
    .modal-header {
        padding: 1.75rem 1.5rem 1.25rem 1.5rem;
    }
    
    .modal-header h3 {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .modal-header p {
        font-size: 0.9375rem;
    }
    
    /* Modal body - better spacing */
    .modal-body {
        padding: 1.25rem;
    }
    
    /* CRITICAL: Single column layout for cards */
    .modal-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.25rem;
        grid-template-columns: none !important;
    }
    
    /* Card styling - mobile optimized */
    .btn-modal {
        width: 100%;
        padding: 1.75rem 1.5rem;
        border-radius: 18px;
        position: relative;
        /* Better touch targets */
        min-height: auto;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(16, 185, 129, 0.1);
        touch-action: manipulation;
        user-select: none;
        -webkit-user-select: none;
    }
    
    /* HOVER/TOUCH STATES - Mobile friendly */
    .btn-modal:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Remove hover effects, add active/expanded states */
    .btn-modal.expanded {
        border-color: #10b981;
        box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.3);
        background: rgba(16, 185, 129, 0.02);
    }
    
    .btn-modal.expanded::before {
        opacity: 1;
    }
    
    /* Icon circle - mobile size */
    .modal-icon-circle {
        width: 64px;
        height: 64px;
        font-size: 1.75rem;
        margin: 0 auto 1rem auto;
    }
    
    /* Card title */
    .btn-modal h4 {
        font-size: 1.1875rem;
        margin: 0.75rem 0 0.5rem 0;
        line-height: 1.3;
    }
    
    /* Subtitle */
    .modal-subtitle {
        font-size: 0.875rem;
        margin: 0 0 1.25rem 0;
        line-height: 1.4;
    }
    
    /* Feature list - mobile optimized */
    .feature-list {
        margin: 1.25rem 0;
    }
    
    .feature-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
        font-size: 0.875rem;
        line-height: 1.5;
        padding: 0.375rem 0;
    }
    
    .feature-item span:not(.feature-check) {
        flex: 1;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .feature-check {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        font-size: 0.75rem;
        flex-shrink: 0;
        margin-top: 0;
        background: #10b981;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
        line-height: 1;
    }
    
    .btn-modal.supplier .feature-check {
        background: #2563eb;
    }
    
    /* Register button - mobile optimized */
    .register-btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-radius: 14px;
        margin-top: 1.25rem;
        /* Better touch target */
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
    }
    
    .register-btn:active {
        transform: scale(0.97);
    }
    
    /* Modal footer */
    .modal-footer {
        padding: 1.25rem 1.5rem 1.75rem 1.5rem;
    }
    
    .modal-footer p {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    /* Close button - mobile optimized */
    .modal-close {
        width: 44px;
        height: 44px;
        top: 1rem;
        right: 1rem;
        font-size: 1.5rem;
        border-radius: 14px;
        /* Better touch target */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Prevent hover effects on mobile */
    .btn-modal:hover {
        transform: none;
    }
    
    /* Show visual feedback on tap */
    .btn-modal:active:not(.expanded) {
        border-color: #059669;
        background: rgba(16, 185, 129, 0.05);
    }
}

/* Small phones - extra optimizations */
@media (max-width: 480px) {
    .modal-overlay.active {
        padding-top: 1rem;
    }
    
    .modal-content {
        border-radius: 16px;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-header {
        padding: 1.5rem 1.25rem 1rem 1.25rem;
    }
    
    .modal-header h3 {
        font-size: 1.375rem;
    }
    
    .modal-header p {
        font-size: 0.875rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-buttons {
        gap: 1rem;
    }
    
    .btn-modal {
        padding: 1.5rem 1.25rem;
        border-radius: 16px;
    }
    
    .modal-icon-circle {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
    
    .btn-modal h4 {
        font-size: 1.125rem;
    }
    
    .modal-subtitle {
        font-size: 0.8125rem;
    }
    
    .feature-item {
        font-size: 0.8125rem;
        margin-bottom: 0.5rem;
    }
    
    .feature-check {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
        font-size: 0.6875rem;
    }
    
    .register-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .modal-footer {
        padding: 1rem 1.25rem 1.5rem 1.25rem;
    }
    
    .modal-close {
        width: 44px;
        height: 44px;
        font-size: 1.375rem;
        top: 0.875rem;
        right: 0.875rem;
    }
}

/* Extra small phones */
@media (max-width: 375px) {
    .modal-header h3 {
        font-size: 1.25rem;
    }
    
    .btn-modal {
        padding: 1.375rem 1rem;
    }
    
    .btn-modal h4 {
        font-size: 1.0625rem;
    }
}

/* ========================================
   LANDSCAPE MODE ON MOBILE
   ======================================== */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-overlay.active {
        padding-top: 0.5rem;
        align-items: center;
    }
    
    .modal-content {
        max-height: calc(100vh - 1rem);
    }
    
    .modal-header {
        padding: 1.25rem 1.5rem 1rem 1.5rem;
    }
    
    .modal-body {
        padding: 1rem 1.25rem;
    }
    
    .btn-modal {
        padding: 1.25rem 1.5rem;
    }
    
    .feature-list {
        margin: 0.875rem 0;
    }
    
    .feature-item {
        margin-bottom: 0.375rem;
    }
}

/* ========================================
   VENDOR REGISTRATION MODAL - MOBILE
   ======================================== */
@media (max-width: 768px) {
    /* Vendor registration modal optimizations */
    .modal-content.vendor-registration {
        max-width: 100%;
        border-radius: 20px;
        max-height: calc(100vh - 4rem);
    }
    
    .registration-header {
        padding: 2rem 1.5rem 1.25rem 1.5rem;
    }
    
    .registration-header h2 {
        font-size: 1.625rem;
    }
    
    .registration-tagline {
        font-size: 0.9375rem;
    }
    
    .registration-progress {
        margin: 0 1.25rem 1.5rem 1.25rem;
        padding: 1rem 1rem 0.75rem 1rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .progress-step {
        min-width: calc(50% - 0.25rem);
    }
    
    .vendor-form {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }
    
    .form-step h3 {
        font-size: 1.375rem;
    }
    
    .step-description {
        font-size: 0.9375rem;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Ensure adequate touch targets (minimum 44x44px) */
@media (max-width: 768px) {
    button,
    .register-btn,
    .modal-close,
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve focus states for keyboard navigation */
    .btn-modal:focus-visible,
    .register-btn:focus-visible,
    .modal-close:focus-visible {
        outline: 3px solid #10b981;
        outline-offset: 2px;
    }
    
    /* Reduce motion for users who prefer it */
    @media (prefers-reduced-motion: reduce) {
        .btn-modal,
        .modal-content,
        .register-btn,
        .modal-close {
            transition: none;
            animation: none;
        }
    }
}

/* ========================================
   PREVENT ZOOM ON INPUT FOCUS (iOS)
   ======================================== */
@media (max-width: 768px) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ========================================
   FEATURE BULLET STYLING - MOBILE FIX
   Ensure circular bullets with checkmarks
   ======================================== */
@media (max-width: 768px) {
    /* Ensure feature list displays properly */
    .feature-list {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin: 1rem 0;
    }
    
    /* Feature item alignment */
    .feature-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.5rem 0;
    }
    
    /* Circular checkmark bullet - Mobile specific */
    .feature-check {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
        max-width: 24px !important;
        max-height: 24px !important;
        background: #10b981 !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #ffffff !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        flex-shrink: 0 !important;
        line-height: 1 !important;
        text-align: center !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        aspect-ratio: 1 / 1 !important;
    }
    
    /* Supplier variant - blue bullets */
    .btn-modal.supplier .feature-check {
        background: #2563eb !important;
    }
    
    /* Delivery partner variant - purple bullets */
    .btn-modal.delivery .feature-check {
        background: #8b5cf6 !important;
    }
    
    /* Feature text */
    .feature-item span:not(.feature-check) {
        flex: 1;
        font-size: 0.875rem;
        line-height: 1.5;
        color: #475569;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Small phones - slightly smaller bullets */
@media (max-width: 480px) {
    .feature-check {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
        max-width: 22px !important;
        max-height: 22px !important;
        font-size: 0.6875rem !important;
    }
    
    .feature-item span:not(.feature-check) {
        font-size: 0.8125rem;
    }
}

/* Ensure no overflow on bullets */
@media (max-width: 768px) {
    .feature-check svg,
    .feature-check img {
        display: none !important;
    }
    
    /* Prevent text wrapping inside bullet */
    .feature-check::before,
    .feature-check::after {
        content: none !important;
    }
}
