/* ============================================
   Timely Pill Website - Responsive Styles
   ============================================ */

/* Tablet Landscape and Below (1024px) */
@media (max-width: 1024px) {
    :root {
        --font-size-3xl: 1.75rem;
        --font-size-4xl: 2rem;
        --font-size-5xl: 2.5rem;
        --spacing-3xl: 4rem;
    }

    .container {
        padding: 0 var(--spacing-md);
    }

    .hero-content {
        gap: var(--spacing-2xl);
    }

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

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }

    .why-content {
        gap: var(--spacing-2xl);
    }

    .download-content {
        gap: var(--spacing-2xl);
    }

    /* Promo Videos */
    .videos-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
}

/* Tablet Portrait and Below (768px) */
@media (max-width: 768px) {
    :root {
        --font-size-2xl: 1.25rem;
        --font-size-3xl: 1.5rem;
        --font-size-4xl: 1.75rem;
        --font-size-5xl: 2rem;
        --spacing-2xl: 3rem;
        --spacing-3xl: 3rem;
    }

    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: var(--spacing-lg);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        z-index: var(--z-fixed);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Hero Section */
    .hero {
        padding: calc(70px + var(--spacing-2xl)) 0 var(--spacing-2xl);
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .hero-text {
        order: 1;
        text-align: center;
    }

    .hero-image {
        order: 2;
    }

    .hero-title {
        font-size: var(--font-size-4xl);
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-store-badges {
        justify-content: center;
        width: 100%;
    }

    /* Hero, Why, and Download mockup images */
    .hero-mockup,
    .why-mockup,
    .download-mockup {
        max-width: 500px;
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Why Section */
    .why-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .why-image {
        order: -1;
    }

    /* Download Section */
    .download-content {
        grid-template-columns: 1fr;
    }

    .download-image {
        order: -1;
    }

    .email-signup {
        flex-direction: column;
    }

    .store-badges {
        justify-content: center;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-links {
        align-items: center;
    }

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

/* Mobile Landscape (640px) */
@media (max-width: 640px) {
    :root {
        --font-size-xl: 1.125rem;
        --font-size-2xl: 1.25rem;
        --font-size-3xl: 1.375rem;
        --font-size-4xl: 1.5rem;
        --font-size-5xl: 1.75rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
        --spacing-2xl: 2.5rem;
        --spacing-3xl: 2.5rem;
    }

    .section-header {
        margin-bottom: var(--spacing-2xl);
    }

    .section-title {
        font-size: var(--font-size-3xl);
    }

    .section-subtitle {
        font-size: var(--font-size-base);
    }

    /* Hero */
    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
    }

    .hero-description {
        font-size: var(--font-size-base);
    }

    .hero-badges .badge {
        font-size: var(--font-size-xs);
        padding: var(--spacing-xs) var(--spacing-md);
    }

    /* Features */
    .feature-card {
        padding: var(--spacing-lg);
    }

    .feature-icon {
        width: 56px;
        height: 56px;
    }

    .feature-title {
        font-size: var(--font-size-lg);
    }

    /* FAQ */
    .faq-question {
        padding: var(--spacing-md);
        font-size: var(--font-size-base);
    }

    .faq-answer p {
        padding: 0 var(--spacing-md) var(--spacing-md);
        font-size: var(--font-size-sm);
    }

    /* Hero, Why, and Download mockup images */
    .hero-mockup,
    .why-mockup,
    .download-mockup {
        max-width: 400px;
    }

    /* Promo Videos */
    .videos-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Why Items */
    .why-item {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .why-icon {
        font-size: var(--font-size-2xl);
    }

    /* Store Badges */
    .store-badge {
        height: 45px;
    }

    .coming-soon-label {
        font-size: 0.65rem;
        padding: 4px var(--spacing-sm);
    }
}

/* Mobile Portrait (480px) */
@media (max-width: 480px) {
    :root {
        --spacing-md: 1rem;
        --spacing-lg: 1.25rem;
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Navigation */
    .logo-text {
        font-size: var(--font-size-lg);
    }

    .logo-img {
        width: 32px;
        height: 32px;
    }

    /* Hero */
    .hero {
        padding: calc(70px + var(--spacing-xl)) 0 var(--spacing-xl);
    }

    .scroll-indicator {
        display: none;
    }

    /* Buttons */
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--font-size-sm);
    }

    /* Features */
    .features,
    .why-section,
    .faq,
    .download {
        padding: var(--spacing-2xl) 0;
    }

    .feature-card {
        padding: var(--spacing-md);
    }

    .feature-icon {
        width: 48px;
        height: 48px;
        margin-bottom: var(--spacing-md);
    }

    .feature-icon svg {
        width: 24px;
        height: 24px;
    }

    /* Hero, Why, and Download mockup images */
    .hero-mockup,
    .why-mockup,
    .download-mockup {
        max-width: 350px;
    }

    /* Why Section */
    .why-item h3 {
        font-size: var(--font-size-base);
    }

    .why-item p {
        font-size: var(--font-size-sm);
    }

    .store-badges {
        flex-direction: column;
        align-items: center;
    }

    .store-badge-link {
        display: block;
        text-align: center;
    }

    .badge-coming-soon {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .store-badge {
        height: 50px;
        width: auto;
        max-width: 100%;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-2xl) 0 var(--spacing-md);
    }

    .footer-logo-img {
        width: 32px;
        height: 32px;
    }

    .footer-logo-text {
        font-size: var(--font-size-lg);
    }

    .footer-heading {
        font-size: var(--font-size-base);
    }

    .footer-description,
    .footer-links a {
        font-size: var(--font-size-sm);
    }
}

/* Extra Small Mobile (360px) */
@media (max-width: 360px) {
    :root {
        --font-size-3xl: 1.25rem;
        --font-size-4xl: 1.375rem;
        --font-size-5xl: 1.5rem;
    }

    .hero-title {
        font-size: var(--font-size-4xl);
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }

    /* Hero, Why, and Download mockup images */
    .hero-mockup,
    .why-mockup,
    .download-mockup {
        max-width: 300px;
    }

    .email-input {
        font-size: var(--font-size-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

/* Landscape Orientation (Mobile) */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: calc(70px + var(--spacing-lg)) 0 var(--spacing-lg);
    }

    .scroll-indicator {
        display: none;
    }

    .hero-content {
        grid-template-columns: 1fr 1fr;
    }

    .features,
    .why-section,
    .faq,
    .download {
        padding: var(--spacing-xl) 0;
    }
}

/* High Resolution Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-img,
    .footer-logo-img,
    .hero-mockup,
    .why-mockup,
    .download-mockup {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .tab-btn,
    .faq-question,
    .carousel-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .feature-card:hover {
        transform: none;
    }

    .hover-lift:hover,
    .hover-grow:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .scroll-indicator,
    .carousel-btn,
    .mobile-menu-toggle,
    .email-signup,
    .store-badges {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .hero,
    .features,
    .why-section,
    .faq,
    .download,
    .footer {
        page-break-inside: avoid;
    }

    a {
        text-decoration: underline;
    }

    .section-title,
    .hero-title {
        color: black;
    }
}

/* Dark Mode Support (System Preference) */
@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode styles if needed in future */
}

/* Container Queries (Future-proofing) */
@supports (container-type: inline-size) {
    .feature-card {
        container-type: inline-size;
    }

    @container (max-width: 300px) {
        .feature-icon {
            width: 48px;
            height: 48px;
        }

        .feature-title {
            font-size: var(--font-size-base);
        }

        .feature-description {
            font-size: var(--font-size-sm);
        }
    }
}
