/* Travel Video Map — frontend styles */

/* ─── Filter bar ──────────────────────────────────────────────────── */

.tvm-map-wrapper {
    position: relative;
}

.tvm-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tvm-filter-bar select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    min-width: 160px;
}

.tvm-filter-bar select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.tvm-filter-bar select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── Map container ────────────────────────────────────────────────── */

.tvm-map {
    width: 100%;
    min-height: 300px;
    background: #e8ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    /* border-radius and box-shadow can be overridden by inline styles from settings. */
}

/* ─── Modal overlay ────────────────────────────────────────────────── */

.tvm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 25, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    animation: tvm-fade-in 120ms ease-out;
}

@keyframes tvm-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.tvm-modal-card {
    background: #fff;
    color: #1a1a1a;
    border-radius: 8px;
    max-width: 720px;
    width: 100%;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: tvm-slide-up 180ms ease-out;
}

@keyframes tvm-slide-up {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.tvm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    gap: 16px;
}

.tvm-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

.tvm-modal-close {
    background: none;
    border: 0;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 4px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.tvm-modal-close:hover,
.tvm-modal-close:focus {
    background: #f3f4f6;
    color: #111827;
    outline: none;
}

.tvm-modal-body {
    padding: 16px 20px 20px;
    overflow-y: auto;
    flex: 1;
}

.tvm-modal-meta {
    margin: 0 0 8px;
    font-size: 13px;
    color: #6b7280;
}

.tvm-modal-description {
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.55;
}

.tvm-modal-description p:first-child { margin-top: 0; }
.tvm-modal-description p:last-child  { margin-bottom: 0; }

.tvm-modal-empty {
    color: #6b7280;
    font-style: italic;
}

/* ─── Video player ─────────────────────────────────────────────────── */

.tvm-modal-player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

/* Fallback for browsers without aspect-ratio support. */
@supports not (aspect-ratio: 16 / 9) {
    .tvm-modal-player {
        padding-top: 56.25%;
        height: 0;
    }
    .tvm-modal-player iframe {
        position: absolute;
        inset: 0;
    }
}

.tvm-modal-player iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ─── Video tab strip (multi-video locations) ──────────────────────── */

.tvm-video-tabs {
    padding: 4px 0 2px;
}

.tvm-tab-group-heading {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    padding: 8px 0 4px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 8px;
}

.tvm-tab-group-heading:first-child {
    padding-top: 0;
}

.tvm-tab-group-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    margin-bottom: 8px;
}

.tvm-tab-group-row:last-child {
    margin-bottom: 0;
}

.tvm-video-tab {
    flex: 0 0 auto;
    width: 140px;
    padding: 0;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    transition: border-color 120ms ease, transform 120ms ease;
}

.tvm-video-tab:hover {
    transform: translateY(-1px);
}

.tvm-video-tab.is-active {
    border-color: #2563eb;
}

.tvm-video-tab img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.tvm-video-tab-label {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
    color: #374151;
    padding: 2px 4px 6px;
}

/* ─── Mobile ───────────────────────────────────────────────────────── */

@media (max-width: 520px) {
    .tvm-filter-bar select { width: 100%; min-width: 0; }
    .tvm-modal-overlay  { padding: 0; }
    .tvm-modal-card     { border-radius: 0; max-height: 100vh; height: 100vh; }
    .tvm-modal-title    { font-size: 16px; }
    .tvm-video-tab      { width: 110px; }
}
