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

/* Large Devices (Desktops, 1024px and up) */
@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
    
    .generator-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Medium Devices (Tablets, 768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .generator-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small Devices (Phones, up to 767px) */
@media (max-width: 767px) {
    .container {
        padding: 0 1rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 1.875rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .generator-card {
        padding: 1.5rem;
    }
    
    .generator-list {
        justify-content: center;
    }
    
    .generator-item {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Mobile Menu Animation */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Dropdown adjustments for mobile */
    .dropdown-content {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: var(--bg-light);
        border-radius: var(--radius-md);
        margin-top: 0.5rem;
    }
}

/* Extra Small Devices (Phones, up to 480px) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        text-align: center;
    }
    
    .hero-cta {
        width: 100%;
    }
    
    .preview-actions {
        flex-direction: column;
    }
    
    .preview-actions .btn-primary,
    .preview-actions .btn-secondary {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .ad-container,
    .hero-cta,
    .mobile-menu-btn {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0044cc;
        --text-dark: #000000;
        --text-light: #333333;
    }
    
    .generator-card {
        border: 2px solid var(--border-color);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f3f4f6;
        --text-light: #d1d5db;
        --bg-white: #111827;
        --bg-light: #1f2937;
        --border-color: #374151;
    }
    
    .generator-card,
    .feature,
    .ad-container {
        background: #1f2937;
        border-color: #374151;
    }
    
    .hero {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .generator-item:hover,
    .generator-card:hover {
        transform: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
    
    /* Increase tap targets for mobile */
    .nav-link,
    .generator-item,
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .form-input,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Landscape Mode Optimizations */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 2rem 0;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .generator-card {
        padding: 1rem;
    }
}