/* Responsive Design - Mobile First Approach */

/* Tablet Styles - 768px to 1024px */
@media screen and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 24px;
    }
    
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 32px;
    }
    
    .generator-card {
        padding: 32px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.375rem;
    }
}

/* Mobile Styles - up to 768px */
@media screen and (max-width: 768px) {
    /* Header Mobile */
    .nav-menu {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--background);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        gap: 0;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        display: block;
        padding: 16px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu a.active::after {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    /* Hero Mobile */
    .hero {
        padding: calc(var(--header-height) + 40px) 0 40px;
    }
    
    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    /* Generator Mobile */
    .generator-section {
        padding: 40px 0;
    }
    
    .generator-card {
        padding: 24px;
        border-radius: 12px;
    }
    
    .text-input {
        min-height: 100px;
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .output-title {
        font-size: 1.25rem;
    }
    
    .style-card {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 16px;
    }
    
    .style-text {
        font-size: 1.125rem;
        word-break: break-word;
    }
    
    .copy-button {
        width: 100%;
        padding: 14px;
    }
    
    /* Content Mobile */
    .content-section {
        padding: 40px 0;
    }
    
    .seo-content {
        padding: 0 16px;
    }
    
    .seo-content h2 {
        font-size: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .seo-content h3 {
        font-size: 1.25rem;
        margin-top: 1.25rem;
    }
    
    .seo-content p {
        font-size: 0.9375rem;
        line-height: 1.7;
    }
    
    /* Footer Mobile */
    .site-footer {
        padding: 40px 0 20px;
        margin-top: 60px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .footer-bottom {
        padding-top: 20px;
        font-size: 0.875rem;
    }
    
    /* Utilities Mobile */
    .container {
        padding: 0 16px;
    }
}

/* Small Mobile - up to 480px */
@media screen and (max-width: 480px) {
    .logo-text {
        display: none;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.375rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    .generator-card {
        padding: 20px;
    }
    
    .input-area {
        margin-bottom: 32px;
    }
    
    .style-card {
        padding: 14px;
    }
    
    .style-name {
        font-size: 0.75rem;
    }
    
    .style-text {
        font-size: 1rem;
    }
    
    .category-title {
        font-size: 1rem;
    }
    
    .copy-button {
        padding: 12px;
        font-size: 0.9375rem;
    }
}

/* Extra Small Mobile - up to 375px */
@media screen and (max-width: 375px) {
    .hero h1 {
        font-size: 1.375rem;
    }
    
    .hero-subtitle {
        font-size: 0.9375rem;
    }
    
    .text-input {
        min-height: 80px;
        padding: 10px;
    }
    
    .output-title {
        font-size: 1.125rem;
    }
}

/* Landscape Mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .site-header {
        height: 60px;
    }
    
    :root {
        --header-height: 60px;
    }
    
    .nav-wrapper {
        height: 60px;
    }
    
    .hero {
        padding: calc(var(--header-height) + 20px) 0 20px;
    }
    
    .generator-section {
        padding: 30px 0;
    }
}

/* Large Desktop - 1440px and above */
@media screen and (min-width: 1440px) {
    .container {
        max-width: 1320px;
    }
    
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .generator-card {
        padding: 48px;
    }
    
    .text-input {
        min-height: 140px;
        padding: 20px;
        font-size: 18px;
    }
    
    .style-text {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .dark-mode-toggle,
    .mobile-menu-toggle,
    .copy-button,
    .clear-btn {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .generator-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .style-card {
        page-break-inside: avoid;
    }
}

/* Accessibility - 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;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0052CC;
        --border-color: #000000;
        --text-primary: #000000;
        --text-secondary: #333333;
        --background: #FFFFFF;
        --surface: #F0F0F0;
    }
    
    [data-theme="dark"] {
        --primary-color: #66B2FF;
        --border-color: #FFFFFF;
        --text-primary: #FFFFFF;
        --text-secondary: #CCCCCC;
        --background: #000000;
        --surface: #1A1A1A;
    }
    
    .style-card,
    .generator-card {
        border-width: 2px;
    }
}