/* ═══════════════════════════════════════════════════════
   Travel Rewind — Animated globe showing travel history
   ═══════════════════════════════════════════════════════ */

/* ── Section Container ── */
.travel-rewind-section {
    position: relative;
    padding: 80px 0 60px;
    background: linear-gradient(160deg, #0a1628 0%, #0d2137 40%, #0f1b2d 100%);
    color: #e8f0f2;
    overflow: hidden;
}

.travel-rewind-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 210, 189, 0.3), transparent);
}

.rewind-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Header ── */
.rewind-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.rewind-title h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 6px 0 4px;
    letter-spacing: -0.02em;
}

.rewind-title p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 1rem;
    margin: 0;
}

.rewind-title .eyebrow-label {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.12rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94d2bd;
    background: rgba(148, 210, 189, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
}

/* ── Year Tabs ── */
.year-tabs {
    display: flex;
    gap: 8px;
}

.year-tab {
    padding: 8px 20px;
    border: 1px solid rgba(148, 210, 189, 0.25);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
}

.year-tab:hover {
    border-color: rgba(148, 210, 189, 0.5);
    color: #fff;
    background: rgba(148, 210, 189, 0.08);
}

.year-tab.active {
    background: rgba(148, 210, 189, 0.18);
    border-color: #94d2bd;
    color: #94d2bd;
}

/* ── Main Content (Globe + Panel) ── */
.rewind-main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 28px;
}

/* ── Globe ── */
.globe-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #0d2137 0%, #080e1a 100%);
    min-height: 360px;
    max-height: 420px;
}

.globe-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    border: 1px solid rgba(148, 210, 189, 0.1);
    pointer-events: none;
}

#rewind-globe {
    width: 100%;
    height: 100%;
    min-height: 360px;
    max-height: 420px;
}

#rewind-globe canvas {
    border-radius: 20px;
}

/* Loading state */
.globe-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 5;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.globe-loading .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(148, 210, 189, 0.15);
    border-top-color: #94d2bd;
    border-radius: 50%;
    animation: rewind-spin 0.8s linear infinite;
}

@keyframes rewind-spin {
    to { transform: rotate(360deg); }
}

/* ── Trip Info Panel ── */
#trip-panel {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 210, 189, 0.1);
    border-radius: 20px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    backdrop-filter: blur(12px);
    min-height: 260px;
    overflow-y: auto;
}

.trip-panel-placeholder {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
}

.trip-panel-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.trip-panel-placeholder p {
    font-size: 0.95rem;
    margin: 0;
}

/* Trip Details (active trip) */
.trip-details {
    animation: rewindFadeSlideIn 0.35s ease;
}

@keyframes rewindFadeSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.trip-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.round-trip-badge {
    margin-left: 6px;
}

.trip-date {
    display: block;
    margin-top: 14px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.02em;
}

.trip-route {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 10px 0 4px;
    line-height: 1.3;
}

.trip-countries {
    font-size: 0.9rem;
    color: rgba(148, 210, 189, 0.8);
    margin: 0 0 16px;
}

.trip-note {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin: 0 0 18px;
    font-style: italic;
    padding-left: 12px;
    border-left: 2px solid rgba(148, 210, 189, 0.3);
}

.trip-meta {
    display: flex;
    gap: 16px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
}

.trip-meta i {
    margin-right: 6px;
    color: #94d2bd;
}

/* ── Timeline ── */
.rewind-timeline-container {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}

.timeline-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.play-btn,
.speed-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 210, 189, 0.25);
    border-radius: 999px;
    background: rgba(148, 210, 189, 0.08);
    color: #94d2bd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-btn {
    width: 42px;
    height: 42px;
    font-size: 1rem;
}

.speed-btn {
    padding: 0 14px;
    height: 42px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    min-width: 48px;
}

.play-btn:hover,
.speed-btn:hover {
    background: rgba(148, 210, 189, 0.18);
    border-color: #94d2bd;
}

/* Timeline Track */
#timeline-track {
    flex: 1;
    position: relative;
    height: 60px;
    user-select: none;
}

.timeline-bar {
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.timeline-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #94d2bd, #0a9396);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.timeline-months {
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    pointer-events: none;
}

.month-marker {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.timeline-dots {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
}

.timeline-dot {
    position: absolute;
    transform: translateX(-50%);
    top: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: #0d2137;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
    z-index: 2;
}

.timeline-dot .dot-icon {
    font-size: 0.7rem;
    line-height: 1;
}

.timeline-dot:hover {
    border-color: #94d2bd;
    transform: translateX(-50%) scale(1.15);
}

.timeline-dot.active {
    border-color: #94d2bd;
    background: rgba(148, 210, 189, 0.2);
    transform: translateX(-50%) scale(1.3);
    z-index: 3;
    box-shadow: 0 0 12px rgba(148, 210, 189, 0.35);
}

.timeline-dot.completed {
    border-color: rgba(148, 210, 189, 0.4);
    background: rgba(148, 210, 189, 0.1);
}

.no-trips {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
    text-align: center;
    padding-top: 14px;
}

/* ── Year Summary Stats ── */
#rewind-stats {
    display: none;
    justify-content: center;
    margin-top: 24px;
}

.stats-card {
    display: flex;
    gap: 32px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 210, 189, 0.12);
    border-radius: 16px;
    padding: 24px 40px;
    animation: rewindFadeSlideIn 0.5s ease;
}

.stats-card .stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #94d2bd;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-lbl {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

/* ── Transport Marker on Globe ── */
.transport-marker {
    font-size: 22px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
    transform: translate(-50%, -50%);
    pointer-events: none;
    line-height: 1;
}

/* ── Legend ── */
.rewind-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
}

.legend-swatch {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

/* Arc colors matching JS config */
.legend-swatch.flight { background: #60a5fa; }
.legend-swatch.train  { background: #fb923c; }
.legend-swatch.car    { background: #a78bfa; }
.legend-swatch.ship   { background: #2dd4bf; }
.legend-swatch.bus    { background: #fbbf24; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .rewind-main {
        grid-template-columns: 1fr 260px;
    }

    .trip-route {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .travel-rewind-section {
        padding: 60px 0 36px;
    }

    .rewind-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 28px;
    }

    .rewind-main {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .globe-wrapper,
    #rewind-globe {
        min-height: 280px;
        max-height: 320px;
    }

    #trip-panel {
        min-height: auto;
        padding: 18px 16px;
    }

    .trip-route {
        font-size: 1.2rem;
    }

    .trip-note {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    /* Timeline: put controls on same line, shrink dots */
    .rewind-timeline-container {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 0;
    }

    #timeline-track {
        width: 100%;
        order: 2;
        height: 50px;
    }

    .timeline-controls {
        order: 1;
    }

    .timeline-dot {
        width: 20px;
        height: 20px;
    }

    .timeline-dot .dot-icon {
        font-size: 0.55rem;
    }

    .play-btn {
        width: 38px;
        height: 38px;
    }

    .speed-btn {
        height: 38px;
        padding: 0 12px;
    }

    .stats-card {
        flex-wrap: wrap;
        gap: 16px;
        padding: 18px 20px;
    }

    .stat-num {
        font-size: 1.4rem;
    }

    .rewind-title h2 {
        font-size: 1.7rem;
    }

    .rewind-legend {
        gap: 14px;
        margin-top: 12px;
    }

    .legend-item {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .travel-rewind-section {
        padding: 50px 0 28px;
    }

    .rewind-wrapper {
        padding: 0 14px;
    }

    .year-tabs {
        width: 100%;
    }

    .year-tab {
        flex: 1;
        text-align: center;
        padding: 7px 10px;
        font-size: 0.85rem;
    }

    .globe-wrapper,
    #rewind-globe {
        min-height: 240px;
        max-height: 280px;
    }

    .rewind-title h2 {
        font-size: 1.5rem;
    }

    .rewind-title p {
        font-size: 0.9rem;
    }

    .trip-type-badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .trip-date {
        font-size: 0.8rem;
    }

    .trip-route {
        font-size: 1.1rem;
    }

    .trip-countries {
        font-size: 0.8rem;
    }

    .trip-note {
        font-size: 0.8rem;
    }

    .trip-meta {
        font-size: 0.8rem;
    }

    .stats-card .stat {
        min-width: 55px;
    }

    .stat-num {
        font-size: 1.2rem;
    }

    .stat-lbl {
        font-size: 0.65rem;
    }

    /* Hide month labels on very small screens — too cramped */
    .month-marker {
        display: none;
    }

    .timeline-dot {
        width: 18px;
        height: 18px;
    }

    .timeline-dot .dot-icon {
        font-size: 0.5rem;
    }

    .transport-marker {
        font-size: 16px;
    }
}
