/* Week 3 polish features */

/* Staggered reveal rhythm */
.reveal-stagger {
    transition-delay: var(--reveal-delay, 0ms);
}

/* Booking progress */
.booking-progress {
    position: sticky;
    top: 84px;
    z-index: 5;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.booking-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.booking-progress-label {
    font-weight: 700;
    color: var(--text-dark);
}

.booking-progress-text {
    color: var(--primary);
    font-weight: 600;
}

.booking-progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--gray-100);
    overflow: hidden;
}

.booking-progress-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.3s ease;
}

.booking-progress-steps {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.booking-progress-step {
    font-size: 0.78rem;
    color: var(--gray-600);
    text-align: center;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    background: var(--light-bg);
}

.booking-progress-step.active {
    color: var(--primary-dark);
    border-color: #b8dff5;
}

.booking-progress-step.done {
    color: #0f766e;
    background: #e7faf6;
    border-color: #9fe8d8;
}

.booking-progress-hint {
    margin: 10px 2px 0;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.booking-progress-hint.is-ready {
    color: #0f766e;
    font-weight: 600;
}

.form-section.is-complete .form-step-badge {
    background: var(--success);
    color: #fff;
}

/* Tooltip */
.form-group label [data-tooltip] {
    position: relative;
    cursor: help;
    color: var(--primary);
    margin-left: 4px;
}

.field-tooltip {
    display: none;
    position: absolute;
    background: var(--dark);
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.35;
    padding: 8px 10px;
    border-radius: 8px;
    width: max-content;
    max-width: 250px;
    margin-top: 6px;
    z-index: 20;
}

label:hover .field-tooltip,
label:focus-within .field-tooltip,
[data-tooltip]:hover + .field-tooltip {
    display: inline-block;
}

/* Lightbox */
.tour-lightbox {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.tour-lightbox.active {
    display: flex;
}

body.lightbox-open {
    overflow: hidden;
}

.tour-lightbox-image {
    max-width: min(1100px, 92vw);
    max-height: 78vh;
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}

.tour-lightbox-meta {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    width: min(920px, calc(100vw - 36px));
    text-align: center;
    color: #fff;
    pointer-events: none;
}

.tour-lightbox-caption {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 0 3px 16px rgba(0, 0, 0, 0.45);
}

.tour-lightbox-counter {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.82);
}

.tour-lightbox-close,
.tour-lightbox-nav {
    position: absolute;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.tour-lightbox-close:hover,
.tour-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: scale(1.06);
}

.tour-lightbox-close {
    top: 24px;
    right: 24px;
}

.tour-lightbox-nav.prev {
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.tour-lightbox-nav.next {
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

/* Timeline polish */
.itinerary-day-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.itinerary-day-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

/* Skeleton loading */
.is-skeleton {
    position: relative;
    background: linear-gradient(110deg, rgba(0,0,0,0.05) 20%, rgba(255,255,255,0.55) 40%, rgba(0,0,0,0.05) 60%);
    background-size: 220% 100%;
    animation: skeletonShimmer 1.15s linear infinite;
}

.is-skeleton img {
    opacity: 0;
    transition: opacity 0.35s ease;
}

.tour-card-image:not(.is-skeleton) img,
.tour-featured-image:not(.is-skeleton) img,
.gallery-item:not(.is-skeleton) img {
    opacity: 1;
}

@keyframes skeletonShimmer {
    to {
        background-position: -220% 0;
    }
}

/* Dark mode alignment */
:root[data-theme="dark"] .booking-progress {
    background: #242424;
    border-color: #3d3d3d;
}

:root[data-theme="dark"] .booking-progress-step {
    background: #2b2b2b;
    border-color: #404040;
    color: #b8b8b8;
}

:root[data-theme="dark"] .booking-progress-step.active {
    color: #74daff;
    border-color: #2e6f8a;
}

:root[data-theme="dark"] .booking-progress-hint {
    color: #b8b8b8;
}

:root[data-theme="dark"] .booking-progress-hint.is-ready {
    color: #6ee7b7;
}

:root[data-theme="dark"] .field-tooltip {
    background: #111;
}

:root[data-theme="dark"] .is-skeleton {
    background: linear-gradient(110deg, rgba(255,255,255,0.07) 20%, rgba(255,255,255,0.18) 40%, rgba(255,255,255,0.07) 60%);
    background-size: 220% 100%;
}

/* Mobile + reduced-motion tuning */
@media (max-width: 900px) {
    .hero-slide {
        background-attachment: scroll;
    }
}

@media (prefers-reduced-motion: reduce) {
    .is-skeleton {
        animation: none;
    }

    .itinerary-day-card,
    .tour-lightbox-close,
    .tour-lightbox-nav,
    .booking-progress-fill {
        transition: none !important;
    }
}

@media (max-width: 900px) {
    .booking-progress {
        position: static;
        top: auto;
    }

    .booking-progress-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .tour-lightbox {
        padding: 10px;
    }

    .tour-lightbox-nav.prev {
        left: 10px;
    }

    .tour-lightbox-nav.next {
        right: 10px;
    }

    .tour-lightbox-close {
        top: 10px;
        right: 10px;
    }

    .tour-lightbox-meta {
        bottom: 14px;
        width: calc(100vw - 20px);
    }

    .tour-lightbox-caption {
        font-size: 0.9rem;
    }
}
