/* ===== RESPONSIVE DESIGN ===== */

/* ===== MOBILE FIRST APPROACH ===== */

/* Base styles are mobile-first (320px+) */

/* ===== SMALL MOBILE (320px - 479px) ===== */
@media (max-width: 479px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* Enhanced Typography Hierarchy */
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: var(--spacing-md);
    }
    
    .section-title {
        font-size: 1.375rem;
        margin-bottom: var(--spacing-md);
    }
    
    .section-title::after {
        width: 40px;
        height: 2px;
    }
    
    /* Enhanced Section Spacing */
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-lg);
    }
    
    .section-divider {
        width: 60px;
        margin: var(--spacing-md) auto;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        justify-content: center;
        width: 100%;
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .info-grid,
    .recipe-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .recipe-card {
        margin-bottom: var(--spacing-lg);
    }
    
    .recipe-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .community-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Navigation adjustments */
    .nav-brand .brand-text {
        font-size: 1rem;
    }
    
    .nav-toggle {
        padding: var(--spacing-xs);
    }
    
    /* Typography adjustments */
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .card-title {
        font-size: 1.125rem;
    }
    
    .tool-title {
        font-size: 1.125rem;
    }
}

/* ===== MOBILE (480px - 767px) ===== */
@media (min-width: 480px) and (max-width: 767px) {
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .community-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .recipe-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
}

/* ===== TABLET (768px - 1023px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 0 var(--spacing-lg);
    }
    
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
        align-items: center;
    }
    
    .hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .recipe-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .community-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
        align-items: center;
    }
    
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
    
    /* Navigation becomes horizontal */
    .nav-menu {
        display: block;
    }
    
    .nav-toggle {
        display: none;
    }
    
    .nav-list {
        display: flex;
        gap: var(--spacing-md);
    }
    
    /* Filter adjustments */
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Modal adjustments */
    .modal {
        max-width: 600px;
        margin: var(--spacing-xl);
    }
}

/* ===== DESKTOP (1024px - 1439px) ===== */
@media (min-width: 1024px) and (max-width: 1439px) {
    .container {
        max-width: 1200px;
        padding: 0 var(--spacing-xl);
    }
    
    .hero-section {
        padding: var(--spacing-3xl) 0;
    }
    
    .info-grid,
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-xl);
    }
    
    .recipe-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xl);
    }
    
    .filter-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Enhanced hover effects for desktop */
    .recipe-card:hover {
        transform: translateY(-8px);
    }
    
    .info-card:hover,
    .tool-card:hover {
        transform: translateY(-6px);
    }
    
    /* Better spacing for larger screens */
    .section-header {
        margin-bottom: var(--spacing-3xl);
    }
    
    .section-footer {
        margin-top: var(--spacing-3xl);
    }
}

/* ===== LARGE DESKTOP (1440px+) ===== */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
        padding: 0 var(--spacing-2xl);
    }
    
    .hero-section {
        padding: 5rem 0;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-description {
        font-size: 1.25rem;
        max-width: 600px;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .section-subtitle {
        font-size: 1.25rem;
        max-width: 700px;
    }
    
    /* Larger cards for better visual hierarchy */
    .info-card,
    .tool-card {
        padding: var(--spacing-2xl);
    }
    
    .recipe-card .recipe-content {
        padding: var(--spacing-2xl);
    }
    
    /* Enhanced grid layouts */
    .info-grid,
    .tools-grid {
        gap: var(--spacing-2xl);
    }
    
    .recipe-grid {
        gap: var(--spacing-2xl);
    }
    
    /* Better modal sizing */
    .modal {
        max-width: 800px;
    }
}

/* ===== ULTRA WIDE (1920px+) ===== */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    .hero-section {
        padding: 6rem 0;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .recipe-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== MOBILE MENU STYLES ===== */
@media (max-width: 767px) {
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        transition: transform var(--transition-normal);
        z-index: 999;
    }
    
    .nav-menu.active {
        transform: translateY(0);
    }
    
    .nav-list {
        flex-direction: column;
        padding: var(--spacing-lg);
        gap: 0;
    }
    
    .nav-item {
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        display: block;
        padding: var(--spacing-md) 0;
        border-radius: 0;
        border-bottom: none;
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
    
    /* Language switcher in mobile */
    .language-switcher {
        order: -1;
        margin-right: var(--spacing-md);
    }
    
    .lang-dropdown {
        position: fixed;
        top: 80px;
        right: var(--spacing-md);
        left: auto;
        width: 150px;
    }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (orientation: landscape) and (max-height: 600px) {
    .hero-section {
        padding: var(--spacing-xl) 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: var(--spacing-lg);
    }
    
    .hero-stats {
        margin-bottom: var(--spacing-lg);
    }
    
    .section-header {
        margin-bottom: var(--spacing-xl);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .header,
    .footer,
    .nav-menu,
    .language-switcher,
    .btn,
    .social-links {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0 !important;
    }
    
    .hero-section,
    .info-section,
    .featured-section,
    .quick-access-section,
    .community-section,
    .faq-section {
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }
    
    .recipe-card,
    .info-card,
    .tool-card {
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .section-title {
        border-bottom: 2px solid #000;
        padding-bottom: 0.5rem;
    }
    
    a {
        text-decoration: underline !important;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --bg-primary: #000000;
        --bg-secondary: #1a1a1a;
        --bg-tertiary: #333333;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --text-muted: #999999;
        --border-color: #666666;
        --border-light: #888888;
        --accent-green: #00ff00;
        --accent-gold: #ffff00;
        --accent-blue: #0080ff;
        --accent-purple: #ff00ff;
    }
    
    .btn-primary {
        background: var(--accent-green);
        color: var(--bg-primary);
        border: 2px solid var(--accent-green);
    }
    
    .btn-secondary {
        background: var(--bg-primary);
        color: var(--accent-green);
        border: 2px solid var(--accent-green);
    }
    
    .btn-outline {
        border-width: 2px;
    }
    
    .recipe-card,
    .info-card,
    .tool-card {
        border-width: 2px;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero-img,
    .recipe-img,
    .community-img {
        transform: none !important;
    }
    
    .recipe-card:hover,
    .info-card:hover,
    .tool-card:hover {
        transform: none !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: light) {
    /* Light mode overrides if needed */
    /* Currently using dark theme as default */
}

/* ===== FOCUS VISIBLE SUPPORT ===== */
@supports selector(:focus-visible) {
    .btn:focus {
        outline: none;
    }
    
    .btn:focus-visible {
        outline: 2px solid var(--accent-green);
        outline-offset: 2px;
    }
    
    .nav-link:focus {
        outline: none;
    }
    
    .nav-link:focus-visible {
        outline: 2px solid var(--accent-green);
        outline-offset: 2px;
    }
}

/* ===== CONTAINER QUERIES (Future Enhancement) ===== */
/* Note: Container queries are not widely supported yet, but can be added when supported */

/* ===== RESPONSIVE IMAGES ===== */
.hero-img,
.recipe-img,
.community-img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

@media (min-width: 768px) {
    .hero-img {
        max-width: 500px;
    }
}

@media (min-width: 1024px) {
    .hero-img {
        max-width: 600px;
    }
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media (max-width: 479px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

@media (min-width: 1440px) {
    html {
        font-size: 17px;
    }
}

@media (min-width: 1920px) {
    html {
        font-size: 18px;
    }
}

/* ===== RESPONSIVE SPACING ===== */
@media (max-width: 479px) {
    :root {
        --spacing-xs: 0.125rem;
        --spacing-sm: 0.25rem;
        --spacing-md: 0.5rem;
        --spacing-lg: 0.75rem;
        --spacing-xl: 1rem;
        --spacing-2xl: 1.5rem;
        --spacing-3xl: 2rem;
    }
}

@media (min-width: 1440px) {
    :root {
        --spacing-xs: 0.375rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1.25rem;
        --spacing-lg: 2rem;
        --spacing-xl: 2.5rem;
        --spacing-2xl: 4rem;
        --spacing-3xl: 5rem;
    }
}