/* Ohoosoo Korea - Responsive Design Optimizations */

/* Mobile-First Responsive Design */

/* Extra Small Devices (phones, 320px and up) */
@media (min-width: 320px) {
    .container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Typography scaling for very small screens */
    html {
        font-size: 14px;
    }
    
    /* Mobile hero adjustments */
    .hero-section h1 {
        font-size: 1.875rem !important; /* 30px */
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-section p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Mobile KPI section - 2x2 grid */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .kpi-card .kpi-number {
        font-size: 2rem !important;
    }
    
    /* Mobile services - 2 columns */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .service-icon-wrapper {
        width: 3rem;
        height: 3rem;
        margin: 0 auto 0.75rem;
    }
    
    .service-icon-wrapper i {
        font-size: 1.25rem;
    }
    
    /* Mobile solutions - 1 column */
    .solutions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Mobile case studies - 1 column */
    .case-studies-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Mobile padding adjustments */
    .section-padding {
        padding: 2rem 0;
    }
    
    /* Mobile buttons */
    .btn-mobile {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* Small Devices (landscape phones, 480px and up) */
@media (min-width: 480px) {
    html {
        font-size: 15px;
    }
    
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .hero-section h1 {
        font-size: 2.25rem !important; /* 36px */
    }
    
    .hero-section p {
        font-size: 1.125rem;
    }
    
    .kpi-card .kpi-number {
        font-size: 2.5rem !important;
    }
    
    .service-icon-wrapper {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    .service-icon-wrapper i {
        font-size: 1.5rem;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
    
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .hero-section h1 {
        font-size: 3rem !important; /* 48px */
    }
    
    .hero-section p {
        font-size: 1.25rem;
    }
    
    /* Tablet KPI section - 4 columns */
    .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .kpi-card .kpi-number {
        font-size: 3rem !important;
    }
    
    /* Tablet services - 3 columns */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .service-icon-wrapper {
        width: 4rem;
        height: 4rem;
    }
    
    .service-icon-wrapper i {
        font-size: 1.75rem;
    }
    
    /* Tablet solutions - 2 columns */
    .solutions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Tablet case studies - 2 columns */
    .case-studies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .section-padding {
        padding: 4rem 0;
    }
    
    /* Tablet navigation adjustments */
    .mobile-menu {
        position: relative;
        background: none;
        border: none;
        padding: 2rem;
    }
}

/* Large Devices (desktops, 1024px and up) */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
        padding-left: 3rem;
        padding-right: 3rem;
    }
    
    .hero-section h1 {
        font-size: 4rem !important; /* 64px */
    }
    
    .hero-section p {
        font-size: 1.5rem;
    }
    
    /* Desktop services - 6 columns */
    .services-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 2rem;
    }
    
    .service-icon-wrapper {
        width: 4rem;
        height: 4rem;
    }
    
    .service-icon-wrapper i {
        font-size: 2rem;
    }
    
    /* Desktop solutions - 4 columns */
    .solutions-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    /* Desktop case studies - 3 columns */
    .case-studies-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .section-padding {
        padding: 6rem 0;
    }
    
    /* Desktop navigation */
    .desktop-nav {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: none;
    }
}

/* Extra Large Devices (large desktops, 1280px and up) */
@media (min-width: 1280px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-section h1 {
        font-size: 5rem !important; /* 80px */
    }
    
    .section-padding {
        padding: 8rem 0;
    }
}

/* Ultra Wide Screens (1920px and up) */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    .hero-section h1 {
        font-size: 6rem !important; /* 96px */
    }
}

/* Mobile-Specific Optimizations */

/* Portrait Orientation */
@media screen and (orientation: portrait) and (max-width: 768px) {
    /* Optimize for portrait mobile */
    .hero-section {
        min-height: 80vh;
        padding-top: 6rem;
    }
    
    .hero-section .container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100%;
    }
    
    /* Stack CTA buttons vertically on portrait */
    .hero-cta-group {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    /* Mobile footer optimization */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
}

/* Landscape Orientation */
@media screen and (orientation: landscape) and (max-height: 600px) {
    /* Optimize for landscape mobile/tablet */
    .hero-section {
        min-height: 100vh;
        padding-top: 4rem;
    }
    
    .section-padding {
        padding: 2rem 0;
    }
    
    /* Reduce vertical spacing in landscape */
    .hero-section h1 {
        margin-bottom: 0.5rem;
    }
    
    .hero-section p {
        margin-bottom: 1rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .touch-target {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .hover-effect:hover {
        transform: none;
    }
    
    /* Optimize button sizes for touch */
    button,
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Improve navigation for touch */
    nav a {
        padding: 0.75rem 1rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    .logo img,
    .icon img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    /* Ensure crisp borders on high DPI */
    .card,
    .btn {
        border-width: 0.5px;
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    /* Disable animations for users who prefer reduced motion */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .parallax {
        transform: none !important;
    }
}

/* Print Styles */
@media print {
    /* Optimize for printing */
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    /* Hide non-essential elements */
    header,
    nav,
    .mobile-menu,
    .cta-section,
    footer,
    .scroll-indicator {
        display: none !important;
    }
    
    /* Optimize layout for print */
    .container {
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Page breaks */
    .section {
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    /* Ensure readable font sizes */
    body {
        font-size: 12pt !important;
        line-height: 1.5 !important;
    }
    
    h1 {
        font-size: 24pt !important;
    }
    
    h2 {
        font-size: 18pt !important;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    /* Basic dark mode styles */
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
    }
    
    /* Apply dark mode when system preference is dark */
    body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }
    
    .card {
        background-color: var(--bg-secondary);
        border-color: #374151;
    }
    
    /* Adjust images for dark mode */
    img {
        opacity: 0.9;
    }
}

/* Container Query Support (Future Enhancement) */
@supports (container-type: inline-size) {
    .responsive-container {
        container-type: inline-size;
    }
    
    /* Use container queries when supported */
    @container (max-width: 500px) {
        .card-grid {
            grid-template-columns: 1fr;
        }
    }
    
    @container (min-width: 501px) and (max-width: 800px) {
        .card-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    
    @container (min-width: 801px) {
        .card-grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }
}

/* Accessibility Enhancements */
@media (prefers-contrast: high) {
    /* Increase contrast for better accessibility */
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 1px solid currentColor;
    }
    
    /* Ensure sufficient color contrast */
    .text-muted {
        color: #4a5568 !important;
    }
}

/* Focus Visible Support */
@supports selector(:focus-visible) {
    button:focus:not(:focus-visible),
    a:focus:not(:focus-visible) {
        outline: none;
    }
    
    button:focus-visible,
    a:focus-visible {
        outline: 2px solid var(--k-beauty-primary);
        outline-offset: 2px;
    }
}

/* CSS Grid Support Detection */
@supports not (display: grid) {
    /* Fallback for browsers without Grid support */
    .grid {
        display: flex;
        flex-wrap: wrap;
    }
    
    .grid > * {
        flex: 1;
        min-width: 300px;
    }
}

/* Flexbox Gap Support */
@supports not (gap: 1rem) {
    /* Fallback for browsers without gap support */
    .flex-gap > * + * {
        margin-left: 1rem;
    }
    
    .flex-gap-vertical > * + * {
        margin-top: 1rem;
    }
}