/*
* Responsive Design Fixes for Mongolia eVisa Website
* Based on comprehensive device testing results
*/

/* Fix for large desktop screens - ensure 3-column layout */
@media (min-width: 1200px) {
    .responsive-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Enhanced mobile optimizations */
@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 1.5rem;
    }
    
    .feature-card {
        padding: 1.25rem !important;
        margin-bottom: 1rem;
    }
    
    .btn-primary {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        text-align: center;
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1199px) {
    .responsive-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem;
    }
    
    .hero-section {
        padding: 4rem 0;
    }
    
    .feature-card {
        padding: 1.75rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .feature-card:hover {
        transform: none;
    }
    
    .btn-primary:hover {
        transform: none;
    }
    
    .touch-target {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Larger touch targets for mobile */
    .navbar-toggler {
        padding: 0.5rem;
        font-size: 1.5rem;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .feature-icon {
        font-size: 3.5rem;
    }
    
    .hero-title {
        font-weight: 700;
    }
}

/* Landscape mobile optimizations */
@media (max-width: 896px) and (orientation: landscape) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
}

/* Ultra-wide screen optimizations */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .responsive-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
        gap: 2.5rem;
    }
    
    .hero-title {
        font-size: 4rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .device-info {
        display: none !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
    }
    
    .feature-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .feature-card {
        background: #2d3748;
        color: white;
    }
    
    .bg-light {
        background: #1a202c !important;
    }
}

/* Focus improvements for keyboard navigation */
.touch-target:focus,
.btn:focus,
.nav-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Loading state improvements */
.loading .feature-card {
    opacity: 0.6;
    pointer-events: none;
}

/* Error state styling */
.error-state {
    border: 2px solid #dc3545;
    background-color: #f8d7da;
}

/* Success state styling */
.success-state {
    border: 2px solid #28a745;
    background-color: #d4edda;
}

