﻿/* ================================================
   MOBILE & TABLET RESPONSIVE ENHANCEMENTS
   Optimized for phones (320px-767px) and tablets (768px-1024px)
   ================================================ */

/* Base Mobile-First Improvements */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

/* Enhanced Touch Targets (minimum 44x44px for accessibility) */
button, 
a, 
input, 
select, 
textarea {
    min-height: 44px;
    min-width: 44px;
}

/* ================================================
   TABLET STYLES (768px - 1024px)
   ================================================ */
@media (max-width: 1024px) and (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-lg);
        max-width: 90%;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }

    .hero-title {
        font-size: 3.5rem;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .hero-visual {
        order: -1;
        max-width: 400px;
        margin: 0 auto;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }

    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }

    .pricing-card.featured {
        transform: scale(1);
        grid-column: span 2;
        max-width: 500px;
        margin: 0 auto;
    }

    /* Dashboard tablet optimizations */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================
   MOBILE LANDSCAPE (481px - 767px)
   ================================================ */
@media (max-width: 767px) and (min-width: 481px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .hero-title {
        font-size: 2.75rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
}

/* ================================================
   MOBILE PORTRAIT (320px - 480px)
   ================================================ */
@media (max-width: 480px) {
    :root {
        --spacing-xs: 0.25rem;
        --spacing-sm: 0.5rem;
        --spacing-md: 0.75rem;
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
    }

    .container {
        padding: 0 var(--spacing-md);
        max-width: 100%;
    }

    /* Navigation */
    .nav-container {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .mobile-menu-btn {
        padding: var(--spacing-sm);
    }

    /* Hero Section */
    .hero {
        padding: 80px 0 var(--spacing-2xl);
        min-height: auto;
    }

    .hero-container {
        gap: var(--spacing-lg);
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: var(--spacing-md);
    }

    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: var(--spacing-lg);
    }

    .hero-cta {
        flex-direction: column;
        gap: var(--spacing-md);
        width: 100%;
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .trust-indicators {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    /* Features */
    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .feature-card,
    .step-card {
        padding: var(--spacing-lg);
    }

    .feature-icon,
    .step-number {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    /* Pricing */
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .pricing-card {
        padding: var(--spacing-lg);
    }

    .amount {
        font-size: 3rem;
    }

    .pricing-plan-name {
        font-size: 1.25rem;
    }

    .pricing-description {
        font-size: 0.875rem;
        min-height: auto;
    }

    .pricing-features li {
        font-size: 0.875rem;
        padding: 0.5rem 0;
    }

    /* Phone Frame */
    .phone-frame {
        width: 200px;
        height: 400px;
    }

    .phone-screen {
        border-radius: 20px;
    }

    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 1rem;
    }

    .form-group {
        margin-bottom: var(--spacing-md);
    }

    /* Cards */
    .card {
        padding: var(--spacing-lg);
        border-radius: 12px;
    }

    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .stat-card {
        padding: var(--spacing-lg);
    }

    /* Marketplace */
    .marketplace-filters {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .number-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .number-card {
        padding: var(--spacing-lg);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }

    .footer-section {
        margin-bottom: var(--spacing-lg);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    /* Section Spacing */
    section {
        padding: var(--spacing-2xl) 0;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: var(--spacing-lg);
    }

    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: var(--spacing-xl);
    }

    /* Modals & Overlays */
    .modal {
        padding: var(--spacing-md);
        width: 95%;
        max-width: 100%;
    }

    .modal-content {
        padding: var(--spacing-lg);
        border-radius: 16px;
    }
}

/* ================================================
   EXTRA SMALL MOBILE (320px - 374px)
   ================================================ */
@media (max-width: 374px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .amount {
        font-size: 2.5rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }

    .phone-frame {
        width: 180px;
        height: 360px;
    }
}

/* ================================================
   IPAD SPECIFIC (768px - 1024px)
   ================================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    /* iPad Portrait & Landscape optimizations */
    .hero-container {
        max-width: 700px;
        margin: 0 auto;
    }

    .pricing-grid {
        max-width: 900px;
        margin: 0 auto;
    }

    .features-grid {
        max-width: 800px;
        margin: 0 auto;
    }
}

/* ================================================
   TOUCH DEVICE ENHANCEMENTS
   ================================================ */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .card:hover,
    .feature-card:hover,
    .pricing-card:hover {
        transform: none;
    }

    /* Add active states instead */
    .card:active,
    .feature-card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }

    .btn:active {
        transform: scale(0.95);
    }

    /* Increase touch target sizes */
    .nav-links a {
        padding: var(--spacing-md) var(--spacing-lg);
    }

    /* Improve scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }
}

/* ================================================
   LANDSCAPE MODE FIXES
   ================================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-xl) 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .modal {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ================================================
   HIGH DPI DISPLAYS (Retina)
   ================================================ */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* Crisp borders and icons */
    .card,
    .btn,
    input,
    select {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ================================================
   ACCESSIBILITY ENHANCEMENTS
   ================================================ */
@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 for mobile devices */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}
