/* ===================================
   RESPONSIVE UTILITIES
   =================================== */

/* Container Utilities */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-sm {
    max-width: 640px;
}

.container-md {
    max-width: 768px;
}

.container-lg {
    max-width: 1024px;
}

/* Display Utilities */
.mobile-only {
    display: block;
}

.tablet-only {
    display: none;
}

.desktop-only {
    display: none;
}

@media (min-width: 768px) {
    .mobile-only {
        display: none;
    }
    
    .tablet-only {
        display: block;
    }
}

@media (min-width: 1024px) {
    .tablet-only {
        display: none;
    }
    
    .desktop-only {
        display: block;
    }
}

/* Grid Utilities */
.grid-responsive {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Spacing Utilities */
@media (max-width: 767px) {
    .mobile-p-0 { padding: 0 !important; }
    .mobile-p-1 { padding: 0.5rem !important; }
    .mobile-p-2 { padding: 1rem !important; }
    .mobile-p-3 { padding: 1.5rem !important; }
    .mobile-p-4 { padding: 2rem !important; }
    
    .mobile-m-0 { margin: 0 !important; }
    .mobile-m-1 { margin: 0.5rem !important; }
    .mobile-m-2 { margin: 1rem !important; }
    .mobile-m-3 { margin: 1.5rem !important; }
    .mobile-m-4 { margin: 2rem !important; }
}

/* Text Utilities */
@media (max-width: 767px) {
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-text-left {
        text-align: left !important;
    }
    
    .mobile-text-sm {
        font-size: 0.875rem !important;
    }
    
    .mobile-text-base {
        font-size: 1rem !important;
    }
}

/* Flex Utilities */
@media (max-width: 767px) {
    .mobile-flex-col {
        flex-direction: column !important;
    }
    
    .mobile-flex-center {
        justify-content: center !important;
        align-items: center !important;
    }
}

/* Width Utilities */
@media (max-width: 767px) {
    .mobile-w-full {
        width: 100% !important;
    }
}

/* Overflow Utilities */
.overflow-x-hidden {
    overflow-x: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

/* Touch Optimization */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    button,
    a,
    input,
    select,
    textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .feature-card:hover,
    .stat-card:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
    
    /* Add active states instead */
    .feature-card:active,
    .stat-card:active {
        transform: scale(0.98);
    }
    
    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.95);
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .mobile-menu-btn,
    .hero-cta,
    .login-form {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .hero-title,
    .section-title {
        color: black;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #ffffff;
        --text-secondary: #ffffff;
    }
    
    .feature-card,
    .stat-card,
    .login-form-card {
        border-width: 2px;
    }
}

/* Dark Mode Override (if system prefers light) */
@media (prefers-color-scheme: light) {
    /* Keep dark theme as default, but can be customized */
}

/* Landscape Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 1rem 40px;
    }
    
    .hero-visual {
        display: none;
    }
}

/* Small Mobile (iPhone SE, etc.) */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }
    
    .feature-card,
    .stat-card {
        padding: 1.25rem;
    }
}

/* Large Desktop */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
}

/* Ultra Wide */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
}
