/* =====================================================
   MedMatch - Responsive Styles
   ===================================================== */

/* Tablet Landscape (1024px and below) */
@media (max-width: 1024px) {
    /* Container */
    .container {
        padding: 0 var(--space-5);
    }
    
    /* Hero Section */
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-16);
    }
    
    .hero-content {
        max-width: 100%;
        margin-bottom: var(--space-12);
        padding-right: 0;
    }
    
    .hero-title {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-visual {
        max-width: 600px;
        margin: 0 auto;
        padding-left: 0;
    }
    
    .floating-cards {
        display: none; /* Hide on tablets for better performance */
    }
    
    /* Benefits */
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    /* Dashboard Preview */
    .dashboard-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    .dashboard-text {
        text-align: center;
        max-width: 100%;
    }
    
    .dashboard-text h2 {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
    }
    
    .feature-list {
        max-width: 400px;
        margin: 0 auto var(--space-8);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-8);
    }
}

/* Tablet Portrait (768px and below) */
@media (max-width: 768px) {
    /* Navigation */
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 80%;
        height: calc(100vh - 70px);
        background: var(--white);
        flex-direction: column;
        padding: var(--space-8) var(--space-6);
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right var(--transition-base);
        overflow-y: auto;
        z-index: 999;
    }
    
    .nav-links.mobile-active {
        right: 0;
    }
    
    .nav-link {
        padding: var(--space-3) 0;
        font-size: var(--font-size-lg);
        width: 100%;
        text-align: left;
    }
    
    .nav-cta {
        display: none; /* Hide desktop CTA */
    }
    
    .menu-btn {
        display: flex;
    }
    
    /* Hero */
    .hero {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: var(--space-16);
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 8vw, 3rem);
        margin-bottom: var(--space-4);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
        margin-bottom: var(--space-6);
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto var(--space-8);
    }
    
    .btn-hero {
        width: 100%;
        justify-content: center;
    }
    
    /* Dynamic Text */
    .dynamic-wrapper {
        height: 2.4em; /* More space for mobile line breaks */
    }
    
    /* Benefits */
    .benefits-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .benefit-card.featured {
        order: -1; /* Move featured card to top */
    }
    
    /* Section Headers */
    .section-title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
    
    /* Timeline */
    .timeline::before {
        display: none; /* Hide timeline line on mobile */
    }
    
    .timeline-item {
        padding: var(--space-6) 0;
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin: 0;
        padding: 0;
        text-align: center;
    }
    
    .timeline-number {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin: 0 auto var(--space-6);
    }
    
    .timeline-img {
        margin: 0 auto;
    }
    
    /* FAQ */
    .faq-question {
        font-size: var(--font-size-base);
        padding: var(--space-4);
    }
    
    .faq-answer {
        font-size: var(--font-size-sm);
    }
    
    /* CTA */
    .cta-content h2 {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
    
    .cta-buttons {
        flex-direction: column;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-brand {
        max-width: 100%;
        margin-bottom: var(--space-8);
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-links {
        margin-bottom: var(--space-6);
    }
}

/* Mobile Landscape (640px and below) */
@media (max-width: 640px) {
    /* Typography Scale Down */
    :root {
        --font-size-base: 0.9rem;
        --font-size-lg: 1rem;
        --font-size-xl: 1.125rem;
        --font-size-2xl: 1.25rem;
        --font-size-3xl: 1.5rem;
        --font-size-4xl: 1.875rem;
        --font-size-5xl: 2.25rem;
    }
    
    /* Container */
    .container {
        padding: 0 var(--space-4);
    }
    
    /* Navigation */
    .navbar .container {
        padding-top: var(--space-3);
        padding-bottom: var(--space-3);
    }
    
    .logo-img {
        width: 32px;
        height: 32px;
    }
    
    .logo h1 {
        font-size: var(--font-size-xl);
    }
    
    /* Sections Spacing */
    section {
        padding: var(--space-16) 0;
    }
    
    /* Hero Stats */
    .hero-stats {
        flex-wrap: wrap;
        gap: var(--space-4);
    }
    
    .stat-item {
        flex: 1 1 calc(33.333% - var(--space-4));
        min-width: 80px;
    }
    
    /* Dashboard Browser Mockup */
    .browser-mockup {
        border-radius: var(--radius-lg);
    }
    
    .browser-bar {
        padding: var(--space-2) var(--space-3);
    }
    
    .browser-dots span {
        width: 8px;
        height: 8px;
    }
    
    .browser-url {
        font-size: var(--font-size-xs);
    }
}

/* Mobile Portrait (480px and below) */
@media (max-width: 480px) {
    /* Hero */
    .hero-title {
        font-size: clamp(1.5rem, 10vw, 2.5rem);
    }
    
    .static-text {
        font-size: 0.9em;
    }
    
    .dynamic-text .word {
        font-size: 0.9em;
    }
    
    /* Buttons */
    .btn {
        padding: var(--space-3) var(--space-5);
        font-size: var(--font-size-sm);
    }
    
    /* Benefits */
    .benefit-icon {
        width: 50px;
        height: 50px;
    }
    
    .benefit-icon i {
        font-size: var(--font-size-xl);
    }
    
    /* Timeline */
    .timeline-number {
        width: 50px;
        height: 50px;
        font-size: var(--font-size-lg);
    }
    
    /* Section Headers */
    .section-tag {
        font-size: var(--font-size-xs);
    }
    
    .section-header {
        margin-bottom: var(--space-12);
    }
}

/* Extra Small Devices (380px and below) */
@media (max-width: 380px) {
    /* Container */
    .container {
        padding: 0 var(--space-3);
    }
    
    /* Hero Title Breaking */
    .hero-title {
        word-break: break-word;
        hyphens: auto;
    }
    
    /* Stat Items */
    .stat-item {
        flex: 1 1 100%;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    /* Feature List */
    .feature-item {
        font-size: var(--font-size-sm);
    }
    
    /* CTA */
    .cta-content p {
        font-size: var(--font-size-base);
    }
}

/* Print Styles */
@media print {
    /* Hide non-essential elements */
    .navbar,
    .hero-buttons,
    .floating-cards,
    .cta,
    .footer {
        display: none !important;
    }
    
    /* Reset colors for print */
    body {
        color: #000;
        background: #fff;
    }
    
    /* Ensure sections break properly */
    section {
        page-break-inside: avoid;
    }
    
    /* Show URLs for links */
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper shadows and borders */
    .benefit-card,
    .faq-item,
    .browser-mockup {
        box-shadow: 
            0 1px 1px rgba(0, 0, 0, 0.05),
            0 2px 2px rgba(0, 0, 0, 0.05),
            0 4px 4px rgba(0, 0, 0, 0.05),
            0 8px 8px rgba(0, 0, 0, 0.05),
            0 16px 16px rgba(0, 0, 0, 0.05);
    }
}

/* Landscape Orientation Adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    .hero {
        min-height: auto;
        padding-top: 80px;
        padding-bottom: var(--space-8);
    }
    
    .hero-visual {
        display: none;
    }
    
    .hero-stats {
        margin-bottom: 0;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-cards,
    .parallax {
        animation: none !important;
        transform: none !important;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here when implementing */
}