/* Responsive Design */

/* Extra Large Screens (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Large Screens (1200px and up) */
@media (min-width: 1200px) {
    .hero-container {
        gap: 4rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Medium Screens (992px and up) */
@media (min-width: 992px) {
    .nav-menu {
        display: flex;
    }
    
    .hamburger {
        display: none;
    }
    
    .hero-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .workflow-steps {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .community-content {
        grid-template-columns: 2fr 1fr;
    }
}

/* Small Screens (768px and up) */
@media (min-width: 768px) {
    .hero-actions {
        flex-direction: row;
    }
    
    .hero-stats {
        flex-direction: row;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

/* Large Desktop Screens (1400px and up) */
@media (min-width: 1400px) {
    .nav-container {
        max-width: 1600px;
    }
    
    .nav-menu {
        gap: var(--spacing-lg);
    }
}

/* Medium Desktop Screens (1200px to 1399px) */
@media (max-width: 1399px) and (min-width: 1200px) {
    .nav-menu {
        gap: var(--spacing-sm);
    }
    
    .nav-link {
        padding: 0.5rem 0.5rem;
        font-size: 0.9rem;
    }
}

/* Small Desktop Screens (992px to 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .nav-menu {
        gap: var(--spacing-xs);
    }
    
    .nav-link {
        padding: 0.5rem 0.4rem;
        font-size: 0.85rem;
    }
}

/* Desktop and Tablet - Show desktop buttons */
@media (min-width: 768px) {
    .nav-actions:not(.mobile-menu) {
        display: flex;
    }
    
    .nav-actions.mobile-menu {
        display: none;
    }
}

/* Mobile Screens (767px and down) */
@media (max-width: 767px) {
    /* Global mobile fixes */
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 1rem;
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 2rem;
        transition: left 0.3s ease;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        z-index: 999;
        overflow-y: auto;
    }
    
    /* Mobile menu header */
    .nav-menu .nav-logo {
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid var(--primary-color);
        width: 100%;
        text-align: center;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    /* Mobile menu backdrop */
    .nav-menu::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .nav-menu.active::before {
        opacity: 1;
    }
    
    .nav-link {
        padding: 1rem 0;
        font-size: 1.125rem;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
        color: #1f2937 !important;
        font-weight: 600;
    }
    
    .nav-link:hover {
        color: var(--primary-color) !important;
        background-color: #f9fafb;
    }
    
    .nav-actions.mobile-menu {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }
    
    .nav-actions.mobile-menu .btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        font-weight: 500;
    }
    
    .hamburger {
        display: flex;
        z-index: 1001;
        position: relative;
        padding: 0.5rem;
        margin: -0.5rem;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Combined Hero & Mobile */
    .combined-hero-mobile {
        min-height: 100vh;
        padding: 2rem 0;
    }
    
    .hero-container {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        text-align: center;
        padding: 0 1rem;
        max-width: 100%;
        overflow: hidden;
        display: block !important;
    }
    
    .hero-content {
        width: 100%;
        margin-bottom: 2rem;
    }
    
    .hero-visual {
        width: 100%;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .app-features {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        justify-items: center;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .app-store-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .phone-gallery {
        height: auto !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
        justify-items: center;
        align-items: start;
        padding: 1rem;
        max-width: 100%;
        overflow: visible;
        position: relative !important;
    }
    
    .phone-container {
        width: 140px;
        height: 240px;
        position: relative;
        transform: none !important;
        animation: none !important;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .phone-1, .phone-2, .phone-3, .phone-4, .phone-5 {
        position: relative !important;
        transform: none !important;
        animation: none !important;
        margin: 0 !important;
        width: 100%;
        height: 100%;
    }
    
    .phone-frame {
        width: 100%;
        height: 100%;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
    
    .phone-screen {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Fix other sections overflow */
    .section {
        padding: 3rem 1rem;
        max-width: 100%;
        overflow: hidden;
    }
    
    .section-title {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .section-subtitle {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .feature-card {
        max-width: 100%;
        overflow: hidden;
    }
    
    .feature-card h3 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .feature-card p {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Tab buttons mobile improvements */
    .tab-btn {
        padding: 1rem 1.5rem;
        min-height: 48px;
        touch-action: manipulation;
    }
    
    /* Platform Preview Section Mobile Fix */
    .platform-preview .preview-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
    
    .platform-preview .preview-features {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .platform-preview .preview-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }
    
    /* Community Section Mobile Fix */
    .community .community-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
    
    .community .community-features {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* Platform Statistics Mobile Fix */
    .platform-stats .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }
    
    /* Footer Mobile Fix */
    .footer .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        text-align: center;
    }
    
    .footer .footer-links {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
}

/* Extra Small Mobile Screens (480px and down) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .app-features {
        gap: 0.5rem;
    }
    
    .app-feature {
        font-size: 0.8rem;
    }
    
    .phone-gallery {
        height: auto;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.5rem;
        max-width: 100%;
        overflow: visible;
    }
    
    .phone-container {
        width: 120px;
        height: 200px;
        transform: none !important;
        animation: none !important;
    }
    
    .phone-1, .phone-2, .phone-3, .phone-4, .phone-5 {
        transform: none !important;
        animation: none !important;
    }
    
    .app-store-btn {
        width: 100%;
        max-width: 200px;
    }
    
    /* Platform Preview Section Small Mobile Fix */
    .platform-preview .preview-stats {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }
    
    .platform-preview .preview-feature {
        padding: 1rem;
    }
    
    /* Community Section Small Mobile Fix */
    .community .community-features {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }
    
    /* Platform Statistics Small Mobile Fix */
    .platform-stats .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }
    
    .platform-stats .stat-item {
        padding: 1rem;
    }
}

/* iPhone 14 Pro Max Specific (430px width) */
@media (max-width: 430px) {
    .hero-container {
        padding: 0 0.5rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .phone-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
        padding: 0.5rem;
    }
    
    .phone-container {
        width: 130px;
        height: 220px;
    }
    
    /* Platform Preview iPhone 14 Pro Max Fix */
    .platform-preview .preview-content {
        padding: 0 0.5rem;
    }
    
    .platform-preview .preview-features {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    .platform-preview .preview-stats {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    /* Community iPhone 14 Pro Max Fix */
    .community .community-content {
        padding: 0 0.5rem;
    }
    
    .community .community-features {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    /* Platform Statistics iPhone 14 Pro Max Fix */
    .platform-stats .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
        padding: 0 0.5rem;
    }
    
    /* Footer iPhone 14 Pro Max Fix */
    .footer .footer-content {
        padding: 0 0.5rem;
    }
}

/* Very Small Mobile Screens (360px and down) */
@media (max-width: 360px) {
    .phone-gallery {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        max-width: 100%;
        overflow: visible;
    }
    
    .phone-container {
        width: 100px;
        height: 160px;
        transform: none !important;
        animation: none !important;
    }
    
    .phone-1, .phone-2, .phone-3, .phone-4, .phone-5 {
        transform: none !important;
        animation: none !important;
    }
    
    /* Hero Section */
    .hero {
        min-height: 100vh;
        padding: 2rem 0;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .app-features {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .app-store-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .mockup-phone {
        width: 250px;
        height: 500px;
    }
    
    /* Sections */
    section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1.125rem;
    }
    
    /* Combined Features & Mobile */
    .combined-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .mobile-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .mobile-text {
        padding-right: 0;
    }
    
    .mobile-title {
        font-size: 1.75rem;
    }
    
    .mobile-subtitle {
        font-size: 0.875rem;
    }
    
    .phone-gallery {
        height: 300px;
    }
    
    .phone-container {
        width: 120px;
        height: 200px;
    }
    
    .phone-1, .phone-2, .phone-3, .phone-4, .phone-5 {
        position: relative;
        transform: none;
        animation: none;
        margin: 0.25rem;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    /* How It Works */
    .workflow-tabs {
        flex-direction: column;
        gap: 0.5rem;
        max-width: 300px;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
    }
    
    .workflow-steps {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .step {
        padding: 1.5rem;
    }
    
    .step::after {
        display: none;
    }
    
    .step-number {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .step-content h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .step-content p {
        font-size: 0.875rem;
    }
    
    /* Success Stories */
    .stories-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .story-card {
        text-align: center;
    }
    
    .story-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Platform Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .stat-item .stat-number {
        font-size: 2rem;
    }
    
    /* Platform Preview Section */
    .preview-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .preview-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .preview-stats {
        flex-direction: row;
        gap: 1rem;
    }
    
    .preview-stat .stat-number {
        font-size: 2rem;
    }
    
    /* Mobile Showcase Section */
    .showcase-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .showcase-title {
        font-size: 2rem;
    }
    
    .showcase-subtitle {
        font-size: 1rem;
    }
    
    .app-features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .app-store-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .phone-gallery {
        height: 400px;
    }
    
    .phone-container {
        width: 150px;
        height: 300px;
    }
    
    .phone-1, .phone-2, .phone-3, .phone-4, .phone-5 {
        position: relative;
        transform: none;
        animation: none;
        margin: 0.5rem;
    }
    
    .phone-gallery {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        height: auto;
        padding: 1rem 0;
    }
    
    /* Registration Section */
    .registration-form-container {
        padding: 1.5rem;
    }
    
    .form-header h3 {
        font-size: 1.5rem;
    }
    
    .tab-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
    }
    
    /* Community */
    .community-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .community-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .community-cta {
        padding: 1.5rem;
    }
    
    .community-cta h3 {
        font-size: 1.5rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .btn-large {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Typography */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.125rem; }
    h6 { font-size: 1rem; }
}

/* Extra Small Screens (480px and down) */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .feature-card {
        padding: 1rem;
    }
    
    .story-content {
        padding: 1rem;
    }
    
    .community-cta {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-item .stat-number {
        font-size: 1.75rem;
    }
    
    .mockup-phone {
        width: 200px;
        height: 400px;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-large {
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* Landscape Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 1rem 0;
    }
    
    .hero-container {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 1rem;
    }
    
    .mockup-phone {
        width: 200px;
        height: 400px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .hero-actions,
    .btn,
    .footer {
        display: none;
    }
    
    .hero {
        background: white;
        color: black;
    }
    
    .hero-background,
    .hero-overlay,
    .hero-particles {
        display: none;
    }
    
    .hero-title,
    .section-title {
        color: black;
    }
    
    .feature-card,
    .story-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo,
    .hero-mockup img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #111827;
        --background-alt: #1f2937;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --border-color: #374151;
    }
    
    .navbar {
        background: rgba(17, 24, 39, 0.95);
        border-bottom-color: var(--border-color);
    }
    
    .feature-card,
    .story-card {
        background: var(--background-alt);
        border-color: var(--border-color);
    }
    
    .btn-secondary {
        background: var(--background-alt);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .btn-outline {
        color: var(--text-primary);
        border-color: var(--border-color);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .hero-particles,
    .particle,
    .animate-float,
    .animate-bounce,
    .animate-pulse,
    .animate-glow,
    .animate-rotate {
        animation: none;
    }
    
    .hover-lift:hover,
    .hover-scale:hover,
    .hover-rotate:hover {
        transform: none;
    }
    
    .btn-animate::before {
        display: none;
    }
}

/* Focus Styles for Accessibility */
@media (prefers-reduced-motion: no-preference) {
    .btn:focus,
    .nav-link:focus,
    .tab-btn:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Container Queries (Future Support) */
@container (min-width: 400px) {
    .feature-card {
        padding: 2rem;
    }
}

@container (min-width: 600px) {
    .workflow-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Hover Support Detection */
@media (hover: hover) {
    .feature-card:hover,
    .story-card:hover {
        transform: translateY(-5px);
    }
}

@media (hover: none) {
    .feature-card:active,
    .story-card:active {
        transform: scale(0.98);
    }
}
