/* Additional Responsive Utilities for Expedia Clone */

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .hero-content h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .search-form-container .card-body {
        padding: 1.5rem;
    }
    
    .nav-pills .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        margin-right: 0.25rem;
    }
    
    .form-control-lg {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .hotel-card img {
        height: 180px;
    }
    
    .feature-card {
        padding: 2rem 1rem;
    }
    
    .footer .col-lg-3 {
        margin-bottom: 2rem;
    }
    
    .promotional-banner {
        padding: 1rem 0;
        font-size: 0.875rem;
    }
    
    .gift-section .col-lg-8,
    .gift-section .col-lg-4 {
        text-align: center;
        margin-bottom: 1rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-content h1 {
        font-size: 2.25rem;
    }
    
    .search-form .row > div {
        margin-bottom: 0.75rem;
    }
    
    .hotel-card img {
        height: 200px;
    }
    
    .feature-card {
        padding: 2.5rem 1.5rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-content h1 {
        font-size: 2.75rem;
    }
    
    .search-form-container {
        margin-top: 1rem;
    }
    
    .hotel-card img {
        height: 220px;
    }
    
    .rewards-section .col-lg-6:first-child {
        margin-bottom: 2rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .container {
        max-width: 960px;
    }
    
    .hotel-card img {
        height: 240px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .container {
        max-width: 1140px;
    }
    
    .hotel-card img {
        height: 250px;
    }
    
    .search-form-container {
        max-width: 1200px;
    }
}

/* Ultra wide screens (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-background {
        background-attachment: fixed;
    }
    
    .search-form-container {
        max-width: 1300px;
    }
}

/* Landscape orientation specific styles */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: 80vh;
    }
    
    .hero-background {
        padding: 3rem 0 2rem;
    }
    
    .hero-content {
        margin-bottom: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
}

/* Print styles for better printing */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .navbar,
    .footer,
    .btn,
    .promotional-banner,
    .gift-section {
        display: none !important;
    }
    
    body {
        font-size: 10pt;
        line-height: 1.2;
        padding-top: 0;
    }
    
    .hero-section {
        background: white;
        color: black;
        padding: 1rem 0;
    }
    
    .search-form-container {
        border: 1px solid black;
        margin: 1rem 0;
    }
    
    .hotel-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        border: 1px solid black;
    }
    
    .feature-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        border: 1px solid black;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 8pt;
    }
    
    h1, h2, h3, h4, h5, h6 {
        break-after: avoid;
    }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
    :root {
        --expedia-primary: #000080;
        --expedia-secondary: #ffd700;
        --expedia-gray-200: #808080;
        --expedia-gray-700: #000000;
    }
    
    .btn-primary {
        background-color: #000080;
        border-color: #000080;
        color: white;
    }
    
    .btn-outline-primary {
        color: #000080;
        border-color: #000080;
    }
    
    .form-control {
        border: 2px solid #000000;
    }
    
    .hotel-card,
    .feature-card {
        border: 2px solid #000000;
    }
}

/* Reduced motion for accessibility */
@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;
    }
    
    .hero-background {
        background-attachment: scroll;
    }
    
    .parallax-element {
        transform: none !important;
    }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    :root {
        --expedia-light: #1e293b;
        --expedia-gray-100: #334155;
        --expedia-gray-200: #475569;
    }
    
    /* Note: Expedia typically doesn't use dark mode, but this provides foundation */
    .bg-light {
        background-color: var(--expedia-light) !important;
    }
    
    .text-muted {
        color: #94a3b8 !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .form-control {
        min-height: 44px;
    }
    
    .hotel-card:hover {
        transform: none;
    }
    
    .feature-card:hover {
        transform: none;
    }
    
    /* Remove hover effects on touch devices */
    .btn:hover,
    .nav-link:hover,
    .hotel-card:hover,
    .feature-card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
}

/* Keyboard navigation improvements */
.btn:focus-visible,
.nav-link:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--expedia-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 61, 130, 0.25);
}

/* Screen reader only content */
.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 for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: white;
    color: var(--expedia-primary);
    padding: 8px 16px;
    z-index: 1000;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Container query support (future-proofing) */
@supports (container-type: inline-size) {
    .hotel-card {
        container-type: inline-size;
    }
    
    @container (max-width: 300px) {
        .hotel-card .card-title {
            font-size: 1rem;
        }
        
        .hotel-card .pricing {
            padding-left: 0.5rem;
        }
    }
}

/* Flexible grid system extensions */
.row-cols-auto > * {
    flex: 0 0 auto;
    width: auto;
}

@media (min-width: 1400px) {
    .row-cols-xxl-5 > * {
        flex: 0 0 auto;
        width: 20%;
    }
    
    .row-cols-xxl-6 > * {
        flex: 0 0 auto;
        width: 16.666667%;
    }
}

/* Utility classes for common patterns */
.aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-ratio-4-3 {
    aspect-ratio: 4 / 3;
}

.aspect-ratio-1-1 {
    aspect-ratio: 1 / 1;
}

/* Custom spacing utilities */
.p-xxl {
    padding: 4rem;
}

.m-xxl {
    margin: 4rem;
}

.gap-xxl {
    gap: 4rem;
}

/* Text wrapping utilities */
.text-wrap-balance {
    text-wrap: balance;
}

.text-wrap-pretty {
    text-wrap: pretty;
}

/* Modern scrollbar styling for Webkit browsers */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--expedia-gray-400) var(--expedia-gray-100);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--expedia-gray-100);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--expedia-gray-400);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--expedia-primary);
}