/* Base Styles & Animations */
.hero-bg {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2)), url('../assets/img/sousse-tour.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
    0% {
        background-size: 100%;
    }
    100% {
        background-size: 110%;
    }
}

.card-zoom {
    overflow: hidden;
    transition: transform 0.3s;
}

.card-zoom:hover {
    transform: translateY(-8px);
}

.card-zoom:hover img {
    transform: scale(1.1);
}

.card-zoom img {
    transition: transform 0.7s ease;
}

.text-shadow {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}

/* Promo Gradients - Important to override any conflicts */
.promo-gradient-1 {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%) !important;
}

.promo-gradient-2 {
    background: linear-gradient(135deg, #d4af37 0%, #a88b2c 100%) !important;
}

h1,
h2,
h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile Menu - Fixed to stay hidden by default */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background: white;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

body.menu-open {
    overflow: hidden;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .hero-bg {
        background-attachment: scroll;
        min-height: 85vh;
        padding-bottom: 2rem;
    }

    #heroContent {
        padding-top: 6rem;
    }

    #bookingForm {
        position: relative;
        margin-top: 2rem;
        margin-bottom: 2rem;
        left: auto;
        bottom: auto;
        transform: none;
        max-width: 100%;
        margin-left: 1rem;
        margin-right: 1rem;
        width: auto;
    }

    .card-zoom:active {
        transform: translateY(-4px);
    }

    button:active,
    a:active {
        transform: scale(0.98);
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Smooth touch scrolling */
* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Better mobile button feedback */
@media (max-width: 768px) {
    button,
    a,
    .card-zoom {
        -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2);
    }

    button:active {
        opacity: 0.8;
    }
}

/* Mobile form improvements */
@media (max-width: 768px) {
    select,
    input[type="date"] {
        -webkit-appearance: none;
        appearance: none;
    }

    input[type="date"]::-webkit-calendar-picker-indicator {
        opacity: 0;
        position: absolute;
        right: 0;
        width: 100%;
        height: 100%;
        cursor: pointer;
    }
}

/* Prevent pull-to-refresh on mobile */
body {
    overscroll-behavior-y: contain;
}

/* Mobile card improvements */
@media (max-width: 768px) {
    .card-zoom {
        touch-action: pan-y;
    }
}

/* Mobile menu item animations */
.mobile-menu nav a {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu.active nav a {
    opacity: 1;
    transform: translateX(0);
}

.mobile-menu.active nav a:nth-child(1) {
    transition-delay: 0.1s;
}

.mobile-menu.active nav a:nth-child(2) {
    transition-delay: 0.15s;
}

.mobile-menu.active nav a:nth-child(3) {
    transition-delay: 0.2s;
}

.mobile-menu.active nav a:nth-child(4) {
    transition-delay: 0.25s;
}

.mobile-menu.active nav a:nth-child(5) {
    transition-delay: 0.3s;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

.pulse-gold {
    animation: pulseGold 2s ease-in-out infinite;
}

@keyframes pulseGold {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(212, 175, 55, 0);
    }
}

.counter {
    font-variant-numeric: tabular-nums;
}

/* Dark Mode Overrides */
.dark body {
    background-color: #0f172a;
    color: #f1f5f9;
}

.dark .bg-white {
    background-color: #1e293b;
}

.dark .text-brand-dark {
    color: #f8fafc;
}

.dark .text-gray-600,
.dark .text-gray-500 {
    color: #94a3b8;
}

.dark .bg-gray-50 {
    background-color: #0f172a;
}

.dark .shadow-xl,
.dark .shadow-2xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

.dark .border-gray-200 {
    border-color: #334155;
}

.dark input,
.dark select {
    color: #f1f5f9;
}

.dark input::placeholder {
    color: #cbd5e1;
}

/* Specific Dark Mode Fixes for Cars */
.dark .car-card {
    background-color: #1e293b;
    border: 1px solid #334155;
}

/* Date picker cell styles */
.picker-date-cell {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.picker-date-cell:hover:not(.selected):not(.disabled) {
    background-color: #f3f4f6;
    transform: scale(1.1);
}

.picker-date-cell.selected {
    background-color: #dcb226 !important;
    color: white !important;
    font-weight: 700 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.picker-date-cell.in-range {
    background-color: #fefae2 !important;
    color: #1d2f7f !important;
    font-weight: 600;
}

.picker-date-cell.disabled {
    color: #d1d5db;
    cursor: not-allowed;
    opacity: 0.5;
}

.picker-date-cell.disabled:hover {
    transform: none;
    background-color: transparent;
}

.picker-time-slot {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.875rem;
    border-radius: 0.5rem;
}

.picker-time-slot:hover {
    background-color: #f3f4f6;
    transform: translateX(0.25rem);
}

.picker-time-slot.selected {
    background-color: #111827;
    color: white;
    font-weight: 700;
}

/* Additional fixes for booking page */
.peer:checked ~ div {
    border-color: #1f2937 !important;
    background-color: #f9fafb !important;
}

/* Ensure gradients work properly */
.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.from-gray-800 {
    --tw-gradient-from: #1f2937;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(31, 41, 55, 0));
}

.to-gray-900 {
    --tw-gradient-to: #111827;
}

.from-red-600 {
    --tw-gradient-from: #dc2626;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(220, 38, 38, 0));
}

.to-red-700 {
    --tw-gradient-to: #b91c1c;
}

/* Ensure sticky positioning works */
.sticky {
    position: sticky;
    position: -webkit-sticky;
}

/* Line clamp utility */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Backdrop blur support */
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
    .backdrop-blur-sm {
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
    
    .backdrop-blur-md {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

/* Fix for overflow issues */
.overflow-y-auto {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}