/* WebKeun Responsive Styles */
/* Mobile First Approach */

/* Extra Small Devices (phones, 320px and up) */
@media (min-width: 320px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-section p {
        font-size: 1.125rem;
    }
}

/* Small Devices (phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
        margin: 0 auto;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .grid-cols-2-sm {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .hero-section h1 {
        font-size: 3rem;
    }
    
    .md\\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .md\\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .md\\:flex-row {
        flex-direction: row;
    }
    
    .md\\:text-left {
        text-align: left;
    }
    
    .md\\:text-4xl {
        font-size: 2.25rem;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .hero-section h1 {
        font-size: 3.5rem;
    }
    
    .lg\\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .lg\\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .lg\\:flex {
        display: flex;
    }
    
    .lg\\:hidden {
        display: none;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .hero-section h1 {
        font-size: 4rem;
    }
    
    .xl\\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 2XL Devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .break-after {
        page-break-after: always;
    }
    
    .break-before {
        page-break-before: always;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .bg-gray-900,
    .bg-green-600,
    .bg-blue-600 {
        background: #fff !important;
        color: #000 !important;
    }
}

/* 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;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --text-dark: #000000;
        --text-light: #000000;
        --border-color: #000000;
    }
    
    .bg-gray-100 {
        background-color: #ffffff;
    }
    
    .border-gray-200 {
        border-color: #000000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* You can add dark mode styles here if needed */
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .hover\\:shadow-lg:hover {
        box-shadow: none;
    }
    
    .hover\\:bg-green-700:hover {
        background-color: initial;
    }
    
    /* Increase touch target sizes */
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Landscape Mobile Optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .mobile-landscape\\:hidden {
        display: none;
    }
}

/* Very Small Screen Optimizations */
@media (max-width: 320px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .text-xs-mobile {
        font-size: 0.75rem;
    }
    
    .px-2-mobile {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Foldable Devices */
@media (max-width: 280px) {
    .foldable\\:text-sm {
        font-size: 0.875rem;
    }
    
    .foldable\\:p-2 {
        padding: 0.5rem;
    }
}

/* iOS Safe Areas */
@supports (padding: max(0px)) {
    .safe-area-padding {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    
    .safe-area-margin {
        margin-left: max(1rem, env(safe-area-inset-left));
        margin-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Performance Optimizations */
@media (prefers-reduced-data: reduce) {
    * {
        background-image: none !important;
    }
    
    .lazy {
        display: none;
    }
}

/* Custom Responsive Utilities */
.responsive-text {
    font-size: clamp(1rem, 4vw, 2rem);
}

.responsive-padding {
    padding: clamp(1rem, 5vw, 3rem);
}

.responsive-gap {
    gap: clamp(1rem, 3vw, 2rem);
}

/* Aspect Ratio Containers */
.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-portrait {
    aspect-ratio: 3 / 4;
}

/* Container Queries Support */
@container (min-width: 400px) {
    .card-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Scroll Snap */
.scroll-snap-x {
    scroll-snap-type: x mandatory;
}

.scroll-snap-y {
    scroll-snap-type: y proximity;
}

.scroll-snap-align-start {
    scroll-snap-align: start;
}

/* Viewport Height Fix for Mobile */
.min-h-screen-mobile {
    min-height: 100vh;
    min-height: 100dvh;
}

.h-screen-mobile {
    height: 100vh;
    height: 100dvh;
}

/* Text Balance */
.text-balance {
    text-wrap: balance;
}

/* Focus Visible Polyfill */
.js-focus-visible :focus:not(.focus-visible) {
    outline: none;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    z-index: 10000;
    text-decoration: none;
}

.skip-link:focus {
    top: 6px;
}