/*
================================================================================
Sublinur Website - Responsive Styles
================================================================================
*/

/* ============================================================================
   Large Desktop (1440px and up)
   ============================================================================ */
@media (min-width: 1440px) {
    :root {
        --container-max-width: 1400px;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
    
    .hero-title {
        font-size: 4rem;
    }
}

/* ============================================================================
   Desktop (1200px to 1439px)
   ============================================================================ */
@media (min-width: 1200px) and (max-width: 1439px) {
    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================================
   Tablet Landscape (1024px to 1199px)
   ============================================================================ */
@media (max-width: 1199px) {
    :root {
        --container-max-width: 960px;
        --spacing-3xl: 4rem;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .section {
        padding: 4rem 0;
    }
}

/* ============================================================================
   Tablet (768px to 1023px)
   ============================================================================ */
@media (max-width: 1023px) {
    :root {
        --container-max-width: 100%;
        --container-padding: 1.25rem;
        --spacing-2xl: 2.5rem;
        --spacing-3xl: 3rem;
    }
    
    /* Typography */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    h4 { font-size: 1.5rem; }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Grid */
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-color);
        padding: var(--spacing-md);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        gap: 0;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu a {
        display: block;
        padding: var(--spacing-md);
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Buttons */
    .btn-large {
        padding: 0.875rem 1.75rem;
        font-size: var(--text-base);
    }
    
    /* Section Padding */
    .section {
        padding: 3rem 0;
    }
}

/* ============================================================================
   Mobile Landscape & Small Tablet (640px to 767px)
   ============================================================================ */
@media (max-width: 767px) {
    :root {
        --container-padding: 1rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
        --spacing-2xl: 2rem;
        --spacing-3xl: 2.5rem;
        --header-height: 70px;
    }
    
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.125rem; }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: var(--text-base);
    }
    
    /* Grid */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    /* Navigation */
    .nav-logo img {
        height: 35px;
    }
    
    .nav-controls {
        gap: var(--spacing-sm);
    }
    
    .language-switcher {
        flex-direction: column;
        position: fixed;
        top: calc(var(--header-height) + 280px);
        left: var(--container-padding);
        right: var(--container-padding);
        background: var(--bg-gray);
        padding: var(--spacing-sm);
        border-radius: var(--radius-md);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
    }
    
    .nav-menu.active ~ .nav-controls .language-switcher {
        opacity: 1;
        visibility: visible;
    }
    
    .lang-btn {
        width: 100%;
        text-align: center;
    }
    
    /* Cards */
    .card-image {
        height: 200px;
    }
    
    /* Buttons */
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: var(--text-sm);
    }
    
    .btn-large {
        padding: 0.75rem 1.5rem;
        font-size: var(--text-base);
    }
    
    .btn-block {
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form button {
        width: 100%;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Section Padding */
    .section {
        padding: 2.5rem 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-xl);
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        padding: var(--spacing-lg);
    }
    
    /* Form */
    .form-input,
    .form-textarea,
    .form-select {
        font-size: var(--text-sm);
    }
}

/* ============================================================================
   Mobile Portrait (480px to 639px)
   ============================================================================ */
@media (max-width: 639px) {
    :root {
        --spacing-md: 1rem;
        --spacing-lg: 1.25rem;
    }
    
    /* Cards */
    .card-body {
        padding: var(--spacing-sm);
    }
    
    .card-title {
        font-size: var(--text-lg);
    }
    
    /* Grid Gap */
    .grid {
        gap: var(--spacing-md);
    }
}

/* ============================================================================
   Small Mobile (up to 479px)
   ============================================================================ */
@media (max-width: 479px) {
    :root {
        --container-padding: 0.875rem;
        --header-height: 60px;
    }
    
    /* Typography */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    /* Navigation */
    .nav-logo img {
        height: 30px;
    }
    
    .mobile-menu-toggle {
        gap: 4px;
    }
    
    .mobile-menu-toggle span {
        width: 22px;
        height: 2px;
    }
    
    /* Buttons */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-large {
        padding: 0.625rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    /* Section */
    .section {
        padding: 2rem 0;
    }
    
    /* Footer */
    .footer-section h3 {
        font-size: var(--text-base);
    }
    
    .social-links a {
        width: 36px;
        height: 36px;
        font-size: var(--text-sm);
    }
}

/* ============================================================================
   Landscape Orientation (Mobile & Tablet)
   ============================================================================ */
@media (max-height: 600px) and (orientation: landscape) {
    .section {
        padding: 2rem 0;
    }
    
    .nav-menu {
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
    }
    
    .modal-content {
        max-height: 85vh;
    }
}

/* ============================================================================
   High Resolution Displays (Retina)
   ============================================================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ============================================================================
   Print Styles
   ============================================================================ */
@media print {
    .main-header,
    .nav-controls,
    .mobile-menu-toggle,
    .main-footer,
    .btn,
    .social-links,
    .newsletter-form {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    a {
        text-decoration: underline;
    }
    
    .section {
        page-break-inside: avoid;
    }
}

/* ============================================================================
   Reduced Motion (Accessibility)
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================================
   Dark Mode Support (Optional for future)
   ============================================================================ */
@media (prefers-color-scheme: dark) {
    /* Can be implemented if dark mode is desired in the future */
    /* Currently keeping light mode only as per design */
}

/* ============================================================================
   Hover States (Only for devices that support hover)
   ============================================================================ */
@media (hover: hover) {
    .btn:hover {
        transform: translateY(-2px);
    }
    
    .card:hover {
        transform: translateY(-5px);
    }
    
    .nav-menu a:hover {
        color: var(--primary-color);
    }
}

/* ============================================================================
   Touch Device Optimizations
   ============================================================================ */
@media (pointer: coarse) {
    /* Larger touch targets for touch devices */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-menu a {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .lang-btn {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .btn:hover,
    .card:hover {
        transform: none;
    }
}

/* ============================================================================
   Container Width Breakpoints
   ============================================================================ */
@media (min-width: 1920px) {
    :root {
        --container-max-width: 1600px;
    }
}

@media (min-width: 2560px) {
    :root {
        --container-max-width: 1920px;
    }
}