@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;700;800&display=swap');

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
}

/* --- TAGS COLORÉS --- */
.tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: inline-block;
}

.tag-direct {
    background: #e0f2fe;
    color: #0369a1;
}

.tag-budget {
    background: #dcfce7;
    color: #15803d;
}

.tag-luxe {
    background: #fef3c7;
    color: #b45309;
}

.tag-famille {
    background: #f3e8ff;
    color: #7e22ce;
}

.tag-nature {
    background: #ecfccb;
    color: #4d7c0f;
}

.tag-culture {
    background: #e0e7ff;
    color: #4338ca;
}

.tag-insolite {
    background: #ffedd5;
    color: #c2410c;
}

.tag-gastronomie {
    background: #fee2e2;
    color: #b91c1c;
}

.tag-eco {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.tag-default {
    background: #f1f5f9;
    color: #475569;
}

/* --- INTERRUPTEUR ÉCO --- */
.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #e2e8f0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #10b981;
}

input:checked+.slider-blue {
    background-color: #0ea5e9 !important;
}

input:checked+.slider:before {
    transform: translateX(18px);
}

/* ═══════════════ HEADER ═══════════════ */
header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ═══════════════ FOOTER ═══════════════ */
footer {
    position: relative;
    overflow: hidden;
}

footer li {
    transition: transform 0.3s ease;
}

footer li:hover {
    transform: translateX(5px);
}

/* ═══════════════ CARDS & GRID ═══════════════ */
#results {
    /* 1 col mobile, 2 col tablette, 3 col desktop */
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    #results {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    #results {
        grid-template-columns: repeat(3, 1fr);
    }
}

.destination-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.destination-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* ═══════════════ SLIDER BLUE (Dates Flexibles) ═══════════════ */
.slider-blue {
    background-color: #f1f5f9;
}

input:checked+.slider-blue {
    background-color: #0ea5e9 !important;
    /* Sky-500 */
}

input:focus+.slider-blue {
    box-shadow: 0 0 1px #0ea5e9;
}

/* ═══════════════ ANIMATIONS ═══════════════ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 640px) {
    header h1 {
        font-size: 2.5rem;
    }

    .glass-input {
        border-radius: 20px;
    }
}

/* --- RÉVÉLATION IMAGE --- */
.img-reveal {
    filter: blur(20px) brightness(0.8);
    transform: scale(1.05);
    transition: filter 1.2s ease, transform 1.2s ease, opacity 0.8s ease;
}

.img-reveal.loaded {
    filter: blur(0) brightness(1);
    transform: scale(1);
    opacity: 1 !important;
}

.city-reveal-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, transparent 100%);
    padding: 1.5rem;
    z-index: 50;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s ease-out;
}

.city-reveal-overlay.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- DROPDOWNS --- */
#autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    margin-top: 8px;
    border: 1px solid #f1f5f9;
    max-height: 200px;
    overflow-y: auto;
}

#travelers-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 260px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
    z-index: 999;
}

#travelers-dropdown.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.btn-counter {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    background: white;
}

/* --- GLASSMORPHISM --- */
.glass-input {
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
}

/* Ensure number inputs are always interactive */
.glass-input input[type="number"],
.glass-input input[type="text"] {
    position: relative;
    z-index: 2;
    cursor: text;
    -webkit-user-select: text;
    user-select: text;
}

/* Fix Firefox number input spinner */
.glass-input input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.glass-input input[type="number"]::-webkit-inner-spin-button,
.glass-input input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

.glass-nav {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- ANIMATIONS --- */
.trip-card {
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.trip-card:hover {
    transform: translateY(-12px) rotate(1deg);
    box-shadow: 0 40px 80px -20px rgba(16, 185, 129, 0.15);
}

.trip-card:hover img {
    transform: scale(1.15);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-animate {
    animation: fadeInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) backwards;
}

.hidden {
    display: none !important;
}

/* --- SMOOTH BUTTON --- */
#btnSearch {
    position: relative;
    overflow: hidden;
}

#btnSearch::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

#btnSearch:hover::after {
    left: 100%;
}

/* ═══════════════ DATE INPUTS ═══════════════ */
input[type="date"] {
    color-scheme: light;
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    filter: invert(0.3);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

input[type="date"]:focus {
    color: #0f172a;
}

/* ═══════════════ VALIDATION ═══════════════ */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

#validation-toast:not(.hidden) {
    animation: slideDown 0.3s ease-out;
}

.\!border-red-400 {
    border-color: #f87171 !important;
}

.\!bg-red-50 {
    background-color: #fef2f2 !important;
}

/* ═══════════════ LEAFLET MAP CARDS ═══════════════ */
/* Keep map under card overlays (weather badge, slogan, eco badge) */
.leaflet-pane {
    z-index: 1 !important;
}

.leaflet-top,
.leaflet-bottom {
    z-index: 2 !important;
}

/* Pulsing marker animation */
@keyframes mapPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* ═══════════════ SEGMENTED CONTROL (Flex Dates) ═══════════════ */
.segmented-control {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.segmented-control button {
    flex: 1;
    padding: 8px 16px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    color: #64748b;
}

.segmented-control button.active {
    background: white;
    color: #0ea5e9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.segmented-control button.active[data-flex="true"] {
    color: #0ea5e9;
}

/* ═══════════════ OVER BUDGET STATE ═══════════════ */
.over-budget {
    opacity: 0.65;
    filter: grayscale(0.4);
    border-color: #fca5a5 !important; /* Red-300 */
    transition: all 0.5s ease;
}

.over-budget:hover {
    opacity: 0.9;
    filter: grayscale(0); transform: none !important;
}