/* Mobile First Responsive Design */

/* Mobile and Tablet Devices (768px and down) */
@media (max-width: 767.98px) {
    /* Hide desktop theme toggle on mobile */
    .theme-toggle {
        display: none !important;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 var(--spacing-md);
        height: 60px;
    }
    
    .nav-logo {
        font-size: 1.25rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .hamburger-menu {
        display: flex;
    }
    
    .nav-actions {
        gap: var(--spacing-sm);
    }
    
    .nav-actions .btn-primary,
    .nav-actions .btn-secondary {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.875rem;
    }
    
    /* Theme Toggle */
    .theme-toggle {
        top: var(--spacing-md);
        right: var(--spacing-md);
    }
    
    .theme-btn {
        width: 40px;
        height: 40px;
    }
    
    /* Hero Section */
    .hero-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        padding: 0 var(--spacing-md);
        text-align: center;
    }
    
    .phone-mockup {
        width: 280px;
        height: 525px;
    }
    
    .scrollable-content {
        max-height: 400px;
    }
    
    .floating-card {
        display: none;
    }
    
    .floating-card.card-1 {
        left: -20%;
    }
    
    .floating-card.card-2 {
        right: -25%;
    }
    
    .floating-card.card-3 {
        left: -15%;
    }
    
    .download-buttons {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
        max-width: 300px;
    }
    
    .download-btn {
        padding: var(--spacing-sm);
    }
    
    .btn-send-message {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: 0.9rem;
    }
    
    .btn-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .mobile-theme-btn {
        width: 45px;
        height: 45px;
    }
    
    .mobile-theme-btn .theme-icon {
        width: 20px;
        height: 20px;
    }
    
    /* Ensure mobile theme toggle is visible */
    .mobile-theme-toggle {
        display: flex !important;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
        gap: var(--spacing-lg);
    }
    
    .phone-mockup {
        width: 250px;
        height: 470px;
    }
    
    /* Features Section */
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .feature-card {
        padding: var(--spacing-lg);
    }
    
    /* How It Works */
    .steps-container {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    .step-connector {
        width: 2px;
        height: 50px;
        margin: 0;
        position: relative;
        top: 0;
    }
    
    /* Download Section */
    .download-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }
    
    .download-title {
        font-size: 2rem;
    }
    
    .download-buttons {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
    
    .download-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .app-preview-cards {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .download-visual {
        min-height: auto;
        gap: var(--spacing-xl);
    }
    
    /* Legal Pages */
    .legal-title {
        font-size: 2.5rem;
    }
    
    .legal-content {
        padding: var(--spacing-xl);
        margin: 0 var(--spacing-md);
    }
    
    .legal-footer {
        flex-direction: column;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .legal-links {
        justify-content: center;
    }
    
    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .contact-form {
        padding: var(--spacing-lg);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Container */
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Section Spacing */
    .features,
    .how-it-works,
    .download,
    .contact {
        padding: var(--spacing-2xl) 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-description {
        font-size: 1rem;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Hide desktop theme toggle on small devices */
    .theme-toggle {
        display: none !important;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 var(--spacing-lg);
    }
    
    .nav-links {
        display: none;
    }
    
    .hamburger-menu {
        display: flex;
    }
    
    /* Ensure mobile theme toggle is visible */
    .mobile-theme-toggle {
        display: flex !important;
    }
    
    /* Hero Section */
    .hero-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
        padding: 0 var(--spacing-lg);
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .phone-mockup {
        width: 280px;
        height: 525px;
    }
    
    /* Features Section */
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* How It Works */
    .steps-container {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    .step-connector {
        width: 2px;
        height: 50px;
        margin: 0;
        position: relative;
        top: 0;
    }
    
    /* Download Section */
    .download-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .download-buttons {
        justify-content: center;
    }
    
    .download-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .app-preview-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Legal Pages */
    .legal-title {
        font-size: 2.25rem;
    }
    
    .legal-content {
        padding: var(--spacing-lg);
        margin: 0 var(--spacing-sm);
    }
    
    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
        gap: var(--spacing-lg);
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Navigation */
    .nav-container {
        padding: 0 var(--spacing-xl);
    }
    
    .nav-links {
        display: flex;
        gap: var(--spacing-lg);
    }
    
    /* Hero Section */
    .hero-container {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2xl);
        padding: 0 var(--spacing-xl);
    }
    
    .hero-title {
        font-size: 3.25rem;
    }
    
    .phone-mockup {
        width: 300px;
        height: 560px;
    }
    
    /* Features Section */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* How It Works */
    .steps-container {
        flex-direction: row;
        gap: var(--spacing-lg);
    }
    
    .step-connector {
        width: 80px;
        height: 2px;
        margin: 0 var(--spacing-sm);
        position: relative;
        top: -32px;
    }
    
    /* Download Section */
    .download-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2xl);
    }
    
    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2xl);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: var(--spacing-lg);
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Hero Section */
    .hero-title {
        font-size: 3.5rem;
    }
    
    /* Features Section */
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xl);
    }
    
    /* How It Works */
    .step-connector {
        width: 100px;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    /* Hero Section */
    .hero-title {
        font-size: 4rem;
    }
    
    /* Features Section */
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xl);
    }
    
    /* How It Works */
    .step-connector {
        width: 120px;
    }
}

/* Ultra Wide Screens (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        min-height: 100vh;
        padding: var(--spacing-xl) 0;
    }
    
    .hero-container {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: row;
        gap: var(--spacing-md);
    }
    
    .hero-stats {
        gap: var(--spacing-lg);
    }
    
    .phone-mockup {
        width: 200px;
        height: 375px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-icon svg,
    .feature-icon svg,
    .contact-icon svg,
    .social-link svg {
        shape-rendering: geometricPrecision;
    }
}

/* Print Styles */
@media print {
    .theme-toggle,
    .navbar,
    .hero-actions,
    .download-buttons,
    .contact-form,
    .footer {
        display: none;
    }
    
    .hero {
        background: white;
        color: black;
    }
    
    .hero-title,
    .section-title {
        color: black;
    }
    
    .glass-card {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .hero-background .gradient-orb {
        animation: none;
    }
    
    .animate-float,
    .animate-pulse,
    .animate-bounce,
    .animate-glow,
    .animate-gradient,
    .animate-morphing,
    .animate-heartbeat,
    .animate-spin,
    .animate-wiggle {
        animation: none;
    }
    
    .hover-lift:hover,
    .hover-scale:hover,
    .hover-rotate:hover {
        transform: none;
    }
    
    .card-hover:hover {
        transform: none;
    }
}

/* Dark Mode Specific Responsive Adjustments */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .glass-card {
        background: rgba(15, 23, 42, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    [data-theme="auto"] .glass-card:hover {
        background: rgba(15, 23, 42, 0.9);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-primary,
    .btn-secondary,
    .download-btn,
    .social-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .theme-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .hover-lift:hover,
    .hover-scale:hover,
    .hover-rotate:hover {
        transform: none;
    }
    
    .card-hover:hover {
        transform: none;
    }
}

/* Container Queries (Future-proofing) */
@container (max-width: 400px) {
    .feature-card {
        padding: var(--spacing-md);
    }
    
    .feature-title {
        font-size: 1.25rem;
    }
}

@container (min-width: 800px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Focus Styles for Accessibility */
@media (prefers-reduced-motion: no-preference) {
    .btn-primary:focus,
    .btn-secondary:focus,
    .download-btn:focus,
    .nav-link:focus,
    .theme-btn:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .glass-card {
        background: var(--bg-primary);
        border: 2px solid var(--text-primary);
    }
    
    .btn-primary {
        background: var(--text-primary);
        color: var(--bg-primary);
    }
    
    .btn-secondary {
        background: var(--bg-primary);
        color: var(--text-primary);
        border: 2px solid var(--text-primary);
    }
}
