/* ─────────────────────────────────────────────────────────────────
   Virtual Fair (Sanal Fuar) — immersive 3-level tour.
   Dark anchor palette per the design system; orange panel headers
   matching the Modoko reference.
   ───────────────────────────────────────────────────────────────── */
:root {
    --th-primary: #e85d1c;
    --fair-bg-1: #1e3a8a;
    --fair-bg-2: #0c1a3b;
    --fair-bg-3: #081330;
    --fair-panel: #0f1e3d;
    --fair-panel-row: #16264d;
    --fair-panel-row-hover: #1f3163;
    --fair-topbar-h: 58px;
}

* { box-sizing: border-box; }

.th-fair-body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--fair-bg-2);
    color: #e5e7eb;
    min-height: 100vh;
}

/* ── Top bar ─────────────────────────────────────── */
.th-fair-topbar {
    height: var(--fair-topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.1rem;
    background: rgba(12, 26, 59, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    position: sticky;
    top: 0;
    z-index: 50;
}
.th-fair-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    text-decoration: none;
    font-size: 1.05rem;
}
.th-fair-brand img { display: block; }
.th-fair-brand-tag {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--th-primary);
    border: 1px solid rgba(232, 93, 28, 0.4);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
}
.th-fair-topbar-actions { display: flex; align-items: center; gap: 0.6rem; }
.th-fair-exit {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #e5e7eb;
    font-weight: 600;
}
.th-fair-exit:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* ── Shell: video stage (left) + side panel (right) ── */
.th-fair-shell { min-height: calc(100vh - var(--fair-topbar-h)); }
.th-fair {
    display: flex;
    min-height: calc(100vh - var(--fair-topbar-h));
}
.th-fair-main {
    flex: 1;
    min-width: 0;
    position: relative;
    background:
        radial-gradient(900px 600px at 20% 10%, rgba(37, 99, 235, 0.14), transparent 60%),
        radial-gradient(800px 600px at 90% 90%, rgba(56, 189, 248, 0.10), transparent 60%),
        linear-gradient(135deg, var(--fair-bg-1), var(--fair-bg-2) 55%, var(--fair-bg-3));
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Video stage ─────────────────────────────────── */
.th-fair-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: calc(100vh - var(--fair-topbar-h));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.th-fair-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}
.th-fair-stage-embed { background: #000; }
.th-fair-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
/* Transparent first-click catcher (foyer sound-on). Above the iframe, below
   the sound button + caption, so the first click anywhere on the video unmutes. */
.th-fair-soundcatch {
    position: absolute;
    inset: 0;
    z-index: 3;
    cursor: pointer;
    background: transparent;
}
.th-fair-sound {
    position: absolute;
    bottom: 1.1rem;
    right: 1.1rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--th-primary);
    color: #fff;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s, filter 0.15s;
    z-index: 5;
}
.th-fair-sound:hover { transform: scale(1.06); filter: brightness(1.05); }

/* Empty / no-video poster */
.th-fair-stage-empty {
    background-size: cover;
    background-position: center;
}
.th-fair-empty-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(12, 26, 59, 0.55);
    padding: 1.4rem 1.8rem;
    border-radius: 1rem;
    backdrop-filter: blur(4px);
}
.th-fair-empty-inner i { font-size: 2.4rem; }
.th-fair-empty-inner span { font-size: 0.9rem; font-weight: 600; }

/* Overlay caption on the video stage (hall title / foyer headline) */
.th-fair-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 2.5rem 2rem 1.4rem;
    background: linear-gradient(transparent, rgba(12, 26, 59, 0.85));
    z-index: 4;
    pointer-events: none;
}
.th-fair-caption-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    color: var(--th-primary);
}
.th-fair-caption-title {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #fff;
    margin: 0.2rem 0 0;
    letter-spacing: -0.01em;
}
.th-fair-caption-sub { color: rgba(255, 255, 255, 0.8); margin: 0.3rem 0 0; font-size: 0.95rem; }
.th-fair-caption-booth {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.6rem;
    background: var(--th-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.th-fair-caption-booth i { font-size: 0.85rem; }

/* ── Side panel ──────────────────────────────────── */
.th-fair-panel {
    width: 360px;
    flex-shrink: 0;
    background: var(--fair-panel);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--fair-topbar-h));
}
.th-fair-panel-head {
    background: var(--th-primary);
    color: #fff;
    padding: 1rem 1.2rem;
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.th-fair-panel-sub {
    padding: 0.7rem 1.2rem;
    font-size: 0.8rem;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.th-fair-panel-body { overflow-y: auto; flex: 1; }

/* Company search inside the foyer panel */
.th-fair-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}
.th-fair-search i { color: #64748b; font-size: 0.95rem; flex-shrink: 0; }
.th-fair-search input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #e5e7eb;
    font-size: 0.9rem;
}
.th-fair-search input::placeholder { color: #64748b; }
.th-fair-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* List rows (halls or companies) */
.th-fair-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
    text-decoration: none;
    transition: background 0.14s;
}
.th-fair-row:hover { background: var(--fair-panel-row-hover); color: #fff; }
.th-fair-row-nav {
    background: var(--fair-panel-row);
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.85rem;
}
.th-fair-row-logo {
    width: 40px; height: 40px;
    border-radius: 9px;
    background: #fff;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.th-fair-row-logo img { max-width: 84%; max-height: 84%; object-fit: contain; }
.th-fair-row-initial {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
}
.th-fair-row-body { flex: 1; min-width: 0; }
.th-fair-row-name {
    font-weight: 600;
    font-size: 0.92rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.th-fair-row-meta { font-size: 0.74rem; color: #94a3b8; margin-top: 0.1rem; }
.th-fair-row-count {
    background: rgba(232, 93, 28, 0.18);
    color: #fdba74;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    flex-shrink: 0;
}
.th-fair-row-arrow { color: #475569; flex-shrink: 0; }
.th-fair-row:hover .th-fair-row-arrow { color: var(--th-primary); }

/* Company info panel (store page) */
.th-fair-info-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}
.th-fair-info-label { color: #94a3b8; font-weight: 600; }
.th-fair-info-value { color: #f1f5f9; text-align: right; word-break: break-word; }
.th-fair-info-value a { color: #fdba74; text-decoration: none; }
.th-fair-info-value a:hover { text-decoration: underline; }

.th-fair-empty-list {
    padding: 2rem 1.2rem;
    text-align: center;
    color: #64748b;
    font-size: 0.88rem;
}

/* ── Small phones: tighten the top bar so it never overflows ──── */
@media (max-width: 600px) {
    .th-fair-topbar { padding: 0 0.6rem; }
    .th-fair-brand-tag { display: none; }
    .th-fair-topbar-actions { gap: 0.4rem; }
    .th-fair-brand img { height: 28px; }
}

/* ── Mobile: stack video over panel ─────────────────── */
@media (max-width: 900px) {
    .th-fair { flex-direction: column; }
    .th-fair-main { min-height: 42vh; }
    .th-fair-stage { min-height: 42vh; }
    .th-fair-panel {
        width: 100%;
        max-height: none;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
    .th-fair-panel-body { overflow-y: visible; }
}
