/**
 * Enhanced Mobile Responsive Styles for ANF Travel
 * Comprehensive mobile optimizations for better UX
 */

/* Base Mobile Optimizations */
@media (max-width: 991.98px) {
    /* Typography improvements */
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.4rem; }
    h4 { font-size: 1.2rem; }
    h5 { font-size: 1.1rem; }
    h6 { font-size: 1rem; }
    
    /* Container improvements */
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
    .col-auto, .col-sm, .col-sm-1, .col-sm-2, .col-sm-3,
    .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8,
    .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-auto,
    .col-md, .col-md-1, .col-md-2, .col-md-3, .col-md-4,
    .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9,
    .col-md-10, .col-md-11, .col-md-12, .col-md-auto,
    .col-lg, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4,
    .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9,
    .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-auto,
    .col-xl, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4,
    .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9,
    .col-xl-10, .col-xl-11, .col-xl-12, .col-xl-auto {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Hero section mobile optimization */
    .hero-section {
        min-height: 60vh;
        padding: 60px 0 40px;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .hero-content .lead {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-btns {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-btns .btn {
        width: 100%;
        margin-right: 0 !important;
    }
    
    .hero-features {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-top: 1.5rem;
    }
    
    .hero-features span {
        font-size: 0.85rem;
    }
}

/* Tablet optimizations */
@media (max-width: 767.98px) {
    /* Card improvements */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .card-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Button improvements */
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-height: 44px;
        border-radius: 8px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 1rem;
        min-height: 48px;
    }
}

/* Mobile phone optimizations */
@media (max-width: 575.98px) {
    /* Form improvements */
    .form-control {
        padding: 12px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
        min-height: 44px;
    }
    
    .form-select {
        padding: 12px 16px;
        font-size: 16px;
        min-height: 44px;
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    .input-group-text {
        padding: 12px 16px;
        font-size: 16px;
    }
    
    /* Navigation improvements */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 12px 16px;
        font-size: 1rem;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }
    
    .navbar-collapse {
        background: white;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        margin-top: 8px;
        padding: 16px;
    }
    
    /* Modal improvements */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }
    
    .modal-content {
        border-radius: 0;
        border: none;
        height: 100%;
    }
    
    .modal-header {
        padding: 16px 20px;
        border-bottom: 1px solid #dee2e6;
    }
    
    .modal-body {
        padding: 20px;
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 16px 20px;
        border-top: 1px solid #dee2e6;
    }
}

/* Flight search form mobile optimization */
@media (max-width: 991.98px) {
    .flight-search-container {
        margin-top: -40px;
        padding: 0 15px;
    }
    
    .flight-search-card {
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    }
    
    .flight-search-form .row {
        margin: 0;
    }
    
    .flight-search-form .col-md-6,
    .flight-search-form .col-md-4,
    .flight-search-form .col-md-3 {
        padding: 0 8px;
        margin-bottom: 16px;
    }
    
    .airport-input-container {
        position: relative;
    }
    
    .airport-suggestions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 1px solid #ddd;
        border-top: none;
        border-radius: 0 0 8px 8px;
        max-height: 200px;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    
    .airport-suggestion {
        padding: 12px 16px;
        cursor: pointer;
        border-bottom: 1px solid #f0f0f0;
        font-size: 14px;
    }
    
    .airport-suggestion:hover,
    .airport-suggestion.highlighted {
        background-color: #f8f9fa;
    }
    
    .airport-suggestion:last-child {
        border-bottom: none;
    }
}

/* Tour cards mobile optimization */
@media (max-width: 767.98px) {
    .tour-card {
        margin-bottom: 20px;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    }
    
    .tour-card .card-img-top {
        height: 200px;
        object-fit: cover;
    }
    
    .tour-card .card-body {
        padding: 16px;
    }
    
    .tour-card .card-title {
        font-size: 1.1rem;
        margin-bottom: 8px;
        line-height: 1.3;
    }
    
    .tour-card .card-text {
        font-size: 0.9rem;
        color: #666;
        margin-bottom: 12px;
    }
    
    .tour-card .price {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--primary, #2563eb);
        margin-bottom: 12px;
    }
    
    .tour-card .btn {
        width: 100%;
        padding: 10px;
        font-weight: 600;
    }
}

/* Footer mobile optimization */
@media (max-width: 767.98px) {
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer .row > div {
        margin-bottom: 30px;
        text-align: center;
    }
    
    .footer h5 {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }
    
    .footer ul {
        padding-left: 0;
    }
    
    .footer .list-unstyled li {
        margin-bottom: 8px;
    }
    
    .footer .social-links {
        justify-content: center;
        gap: 16px;
        margin-top: 20px;
    }
    
    .footer .social-links a {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: var(--primary, #2563eb);
        color: white;
        text-decoration: none;
        transition: transform 0.2s ease;
    }
    
    .footer .social-links a:hover {
        transform: scale(1.1);
    }
}

/* User dropdown mobile optimization */
@media (max-width: 991.98px) {
    .user-profile-dropdown {
        position: static;
    }
    
    .user-profile-dropdown .user-menu {
        position: static;
        visibility: visible;
        opacity: 1;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
        background: transparent;
        padding: 0;
        display: none;
    }
    
    .user-profile-dropdown.show-dropdown .user-menu,
    .user-profile-dropdown.active .user-menu {
        display: block;
    }
    
    .user-profile-dropdown .menu-item {
        padding: 12px 16px;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        background: white;
        margin-bottom: 1px;
        border-radius: 8px;
    }
    
    .user-profile-dropdown .menu-item:hover {
        transform: none;
        background-color: #f8f9fa;
    }
}

/* Search results mobile optimization */
@media (max-width: 767.98px) {
    .search-results {
        padding: 16px;
    }
    
    .search-result-item {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 12px;
        border: 1px solid #e9ecef;
        background: white;
    }
    
    .search-result-item .row {
        margin: 0;
    }
    
    .search-result-item .col-md-8,
    .search-result-item .col-md-4 {
        padding: 0;
    }
    
    .search-result-item .col-md-4 {
        margin-top: 16px;
        text-align: center;
    }
    
    .search-result-item .price {
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--primary, #2563eb);
        margin-bottom: 8px;
    }
    
    .search-result-item .btn {
        width: 100%;
        padding: 12px;
        font-weight: 600;
    }
}

/* Loading animations mobile optimization */
@media (max-width: 767.98px) {
    .loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }
    
    .loading-overlay {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(2px);
    }
    
    .loading-text {
        font-size: 0.9rem;
        margin-top: 12px;
    }
}

/* Touch-friendly improvements */
@media (max-width: 991.98px) {
    /* Increase touch targets */
    a, button, .btn, input, select, textarea {
        min-height: 44px;
    }
    
    /* Improve tap highlighting */
    a, button, .btn {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.2);
    }
    
    /* Prevent text selection on buttons */
    .btn, button {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Improve scroll behavior */
    .modal-body,
    .offcanvas-body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Accessibility improvements */
@media (max-width: 767.98px) {
    /* Focus indicators */
    .form-control:focus,
    .form-select:focus,
    .btn:focus {
        outline: 2px solid var(--primary, #2563eb);
        outline-offset: 2px;
    }
    
    /* Skip links */
    .skip-link {
        position: absolute;
        top: -40px;
        left: 6px;
        background: var(--primary, #2563eb);
        color: white;
        padding: 8px;
        text-decoration: none;
        border-radius: 4px;
        z-index: 9999;
    }
    
    .skip-link:focus {
        top: 6px;
    }
}

/* Performance optimizations */
@media (max-width: 767.98px) {
    /* Reduce animations for better performance */
    .animate-hero-text,
    .animate-hero-text-delay-1,
    .animate-hero-text-delay-2,
    .animate-hero-text-delay-3 {
        animation-duration: 0.6s;
    }
    
    /* Optimize images */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Reduce shadows for better performance */
    .card,
    .modal-content,
    .dropdown-menu {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .modal,
    .offcanvas {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white;
    }
    
    .container,
    .container-fluid {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
}

/* Reduced motion preferences */
@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 support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid #333;
    }
    
    .form-control,
    .form-select {
        border: 2px solid #333;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #1e40af;
        border-color: #3b82f6;
        color: #ffffff;
    }
    
    .form-control,
    .form-select {
        background-color: #ffffff;
        border-color: #3b82f6;
        color: #1e40af;
    }
    
    .modal-content {
        background-color: #ffffff;
        color: #1e40af;
        border: 1px solid #3b82f6;
    }
}