/* ============================================================
   expo-floor-public.css
   PIE 2027 — Public Expo Floor Viewer (no auth, no reservation)
   ============================================================ */

   :root {
    /* Core palette */
    --ink:            #16213E;
    --ink-soft:       #2B3A5E;
    --paper:          #FAFAF7;
    --surface:        #FFFFFF;
    --line:           #E6E2D8;
    --text:           #20263A;
    --text-muted:     #6B7280;
    --text-faint:     #9CA3AF;

    --amber:          #F2A93B;
    --amber-hover:    #DE9526;
    --amber-soft:     #FEF3E0;

    /* Tier palette */
    --gold:           #C8932A;
    --gold-bg:        #FBF3E2;
    --gold-fill:      #E3B655;

    --silver:         #5B6472;
    --silver-bg:      #F1F2F4;
    --silver-fill:    #AAB2BD;

    --bronze:         #A9652E;
    --bronze-bg:      #FBEEE3;
    --bronze-fill:    #C98554;

    --standard:       #3D6FB4;
    --standard-bg:    #EAF1FB;
    --standard-fill:  #7AA3D8;

    --available:      #2F9E6E;
    --available-bg:   #E7F6EF;
    --available-fill: #5BBE93;

    --occupied-fill:  #C7CCD6;
    --occupied-border:#9AA2B1;

    --shadow-sm:      0 1px 2px rgba(22,33,62,.06), 0 1px 1px rgba(22,33,62,.04);
    --shadow-md:      0 6px 20px rgba(22,33,62,.10);
    --shadow-lg:      0 18px 48px rgba(22,33,62,.18);
    --radius-sm:      6px;
    --radius:         12px;
    --radius-lg:      18px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--paper);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.display {
    font-family: 'Barlow Condensed', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    letter-spacing: 0.01em;
}

a { color: inherit; }

::selection { background: var(--amber-soft); color: var(--ink); }

/* ──────────────────────────────────────────
   LOADING
────────────────────────────────────────── */
#loading-overlay {
    position: fixed; inset: 0; z-index: 500;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px;
    background: var(--paper);
}
#loading-overlay.hidden { display: none; }
.spinner {
    width: 34px; height: 34px;
    border: 3px solid var(--line);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-overlay p { color: var(--text-muted); font-size: 14px; }

/* ──────────────────────────────────────────
   PAGE SHELL
────────────────────────────────────────── */
.viewer-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.viewer-header {
    background: var(--ink);
    color: #fff;
    padding: 22px 28px 18px;
    position: relative;
    overflow: hidden;
}
.viewer-header::after {
    content: '';
    position: absolute; right: -60px; top: -60px;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(242,169,59,.18), transparent 70%);
    pointer-events: none;
}
.header-inner {
    max-width: 1480px; margin: 0 auto;
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 24px; flex-wrap: wrap;
    position: relative; z-index: 1;
}
.header-eyebrow {
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 6px;
}
.header-title {
    font-size: 34px;
    line-height: 1;
    color: #fff;
}
.header-sub {
    font-size: 14px;
    color: rgba(255,255,255,.62);
    margin-top: 6px;
    max-width: 46ch;
}
.header-stats {
    display: flex; gap: 22px;
}
.hstat { text-align: right; }
.hstat-num { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 26px; line-height: 1; color: #fff; }
.hstat-label { font-size: 11px; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }

/* ──────────────────────────────────────────
   STATUS / LEGEND STRIP
────────────────────────────────────────── */
.legend-strip {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 11px 28px;
}
.legend-inner {
    max-width: 1480px; margin: 0 auto;
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.legend-item {
    display: flex; align-items: center; gap: 7px;
    font-size: 12.5px; font-weight: 600; color: var(--text-muted);
}
.legend-dot {
    width: 11px; height: 11px; border-radius: 3px;
    display: inline-block;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.ld-available { background: var(--available-fill); }
.ld-standard  { background: var(--standard-fill); }
.ld-bronze    { background: var(--bronze-fill); }
.ld-silver    { background: var(--silver-fill); }
.ld-gold      { background: var(--gold-fill); }
.ld-occupied  { background: var(--occupied-fill); }

/* ──────────────────────────────────────────
   MAIN BODY / LAYOUT
────────────────────────────────────────── */
.viewer-body {
    flex: 1;
    max-width: 1480px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 28px 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: start;
}

@media (max-width: 980px) {
    .viewer-body { grid-template-columns: 1fr; }
    .booth-sidebar { order: 2; }
}

/* ──────────────────────────────────────────
   MAP CARD
────────────────────────────────────────── */
.map-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.map-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    gap: 12px; flex-wrap: wrap;
}
.map-toolbar-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: 18px; color: var(--ink);
}
.search-box {
    position: relative;
    width: 220px;
}
.search-box svg {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-faint); pointer-events: none;
}
.search-box input {
    width: 100%;
    padding: 8px 10px 8px 32px;
    font-size: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    background: var(--paper);
    transition: border-color .15s, background .15s;
}
.search-box input:focus {
    border-color: var(--amber);
    background: #fff;
}

.zoom-controls {
    display: flex; gap: 6px;
}
.zoom-btn {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 7px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background .15s, color .15s, border-color .15s;
}
.zoom-btn:hover { background: var(--amber-soft); color: var(--amber-hover); border-color: var(--amber); }

.map-scroll {
    overflow: auto;
    background:
        linear-gradient(90deg, var(--paper) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(0deg,  var(--paper) 1px, transparent 1px) 0 0 / 24px 24px,
        #F3F1EA;
    max-height: 90vh;
}

.booth-map-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 120%;
    margin: 0 auto;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #fff;
    transform-origin: top center;
    transition: transform .18s ease;
}
.booth-map-container.no-image {
    background-color: var(--paper);
}
.map-missing-note {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-faint); font-size: 13px; text-align: center; padding: 20px;
}

.booth-map-container > .booth { position: absolute; }

/* ── Booth tags ── */
.booth {
    position: absolute;
    cursor: pointer;
    border-radius: 5px;
    border: 1.5px solid rgba(255,255,255,.85);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.booth::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 26%;
    min-height: 4px;
    background: rgba(0,0,0,.12);
}
.booth-label {
    position: relative; z-index: 1;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    color: rgba(0,0,0,.62);
    font-size: clamp(13px, 2vw, 21px);
    text-shadow: 0 1px 1px rgba(255,255,255,.5);
    pointer-events: none;
    text-align: center;
    line-height: 1.1;
}

.booth:hover, .booth.hovered {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px var(--ink), 0 6px 16px rgba(22,33,62,.28);
    z-index: 20;
}
.booth.selected {
    box-shadow: 0 0 0 3px var(--amber), 0 8px 18px rgba(22,33,62,.3);
    z-index: 21;
}

.booth.bt-available { background: var(--available-fill); }
.booth.bt-available::before { background: rgba(0,0,0,.10); }
.booth.bt-standard  { background: var(--standard-fill); }
.booth.bt-bronze    { background: var(--bronze-fill); }
.booth.bt-silver    { background: var(--silver-fill); }
.booth.bt-gold      { background: var(--gold-fill); }

.booth.bt-occupied {
    background: var(--occupied-fill);
    border-color: rgba(255,255,255,.9);
}
.booth.bt-occupied .booth-label { display: none; }

.booth-company-logo {
    position: absolute; inset: 7%;
    width: 86%; height: 86%;
    object-fit: contain;
    border-radius: 3px;
    background: #fff;
    padding: 3px;
}

/* ──────────────────────────────────────────
   SIDEBAR
────────────────────────────────────────── */
.booth-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 16px;
}

.sidebar-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.sidebar-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--line);
}
.sidebar-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: 17px; color: var(--ink);
    margin-bottom: 8px;
}
.filter-pills {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.filter-pill {
    font-size: 11.5px; font-weight: 600;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--text-muted);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.filter-pill:hover { border-color: var(--amber); }
.filter-pill.fp-active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.booth-list {
    max-height: 58vh;
    overflow-y: auto;
}
.booth-list-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background .12s;
}
.booth-list-row:last-child { border-bottom: none; }
.booth-list-row:hover, .booth-list-row.row-hovered {
    background: var(--amber-soft);
}
.booth-list-row.row-selected {
    background: #FFF8EC;
    box-shadow: inset 3px 0 0 var(--amber);
}
.row-id {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: 15px; color: var(--ink);
    width: 38px; flex-shrink: 0;
}
.row-dot {
    width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.row-info { min-width: 0; flex: 1; }
.row-company {
    font-size: 12.5px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-tier {
    font-size: 11px; color: var(--text-muted);
}
.row-empty { text-align: center; color: var(--text-faint); font-size: 13px; padding: 28px 16px; }

/* ──────────────────────────────────────────
   BOOTH POPOVER
────────────────────────────────────────── */
.booth-popover-backdrop {
    position: fixed; inset: 0;
    background: rgba(22,33,62,.38);
    backdrop-filter: blur(2px);
    z-index: 300;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease;
}
.booth-popover-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}
.booth-popover {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    max-height: 86vh;
    overflow-y: auto;
    transform: translateY(8px) scale(.98);
    transition: transform .16s ease;
}
.booth-popover-backdrop.open .booth-popover {
    transform: translateY(0) scale(1);
}

.popover-banner {
    height: 90px;
    position: relative;
    display: flex; align-items: flex-end;
    padding: 0 20px 14px;
}
.popover-banner.pb-available { background: linear-gradient(135deg, var(--available-fill), var(--available)); }
.popover-banner.pb-standard  { background: linear-gradient(135deg, var(--standard-fill), var(--standard)); }
.popover-banner.pb-bronze    { background: linear-gradient(135deg, var(--bronze-fill), var(--bronze)); }
.popover-banner.pb-silver    { background: linear-gradient(135deg, var(--silver-fill), var(--silver)); }
.popover-banner.pb-gold      { background: linear-gradient(135deg, var(--gold-fill), var(--gold)); }
.popover-banner.pb-occupied  { background: linear-gradient(135deg, #DADFE6, #B7BFCC); }

/* ── Occupied booth banners — colored by the company's sponsor tier ── */
.popover-banner.pb-sponsor-standard {
    background: linear-gradient(135deg, #54A8DC, #2f86bb);
}
.popover-banner.pb-sponsor-standard .popover-tier-tag,
.popover-banner.pb-sponsor-standard .popover-booth-id {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.25);
}

.popover-banner.pb-sponsor-bronze {
    background: linear-gradient(135deg, #C98554, #8C4F1E);
}
.popover-banner.pb-sponsor-bronze .popover-tier-tag,
.popover-banner.pb-sponsor-bronze .popover-booth-id {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.28);
}

.popover-banner.pb-sponsor-silver {
    background: linear-gradient(135deg, #BCC4CF, #5B6472);
}
.popover-banner.pb-sponsor-silver .popover-tier-tag {
    color: rgba(255,255,255,.88);
}
.popover-banner.pb-sponsor-silver .popover-booth-id {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.22);
}

.popover-banner.pb-sponsor-gold {
    background: linear-gradient(135deg, #E3B655, #9B6B10);
}
.popover-banner.pb-sponsor-gold .popover-tier-tag {
    color: rgba(255,255,255,.9);
    text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.popover-banner.pb-sponsor-gold .popover-booth-id {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.popover-close {
    position: absolute; top: 12px; right: 14px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.28);
    border: none;
    display: flex; align-items: center; justify-content: center;
    color: #fff; cursor: pointer;
    transition: background .15s;
}
.popover-close:hover { background: rgba(255,255,255,.45); }

.popover-booth-id {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: 26px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.popover-tier-tag {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: rgba(255,255,255,.92);
    margin-bottom: 3px;
}

.popover-body { padding: 18px 20px 20px; }

.popover-company {
    display: block;
    margin-bottom: 14px;
}

/* Horizontal logo — full-width banner */
.popover-horiz-logo-wrap {
    width: 100%;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    max-height: 110px;
    overflow: hidden;
}
.popover-horiz-logo {
    max-width: 100%;
    max-height: 86px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Square logo fallback */
.popover-square-logo-wrap {
    margin-bottom: 10px;
}
.popover-logo {
    width: 64px; height: 64px;
    border-radius: 10px;
    object-fit: contain;
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 6px;
    flex-shrink: 0;
}

/* Reserved booth styles */
.booth.bt-reserved {
    background: var(--occupied-fill);
    border-color: rgba(255,255,255,.8);
    cursor: default;
}
.booth.bt-reserved:hover,
.booth.bt-reserved.hovered {
    transform: none;
    box-shadow: none;
    z-index: auto;
}
.booth-reserved-badge {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(7px, 1.1vw, 12px);
    color: rgba(255,255,255,.9);
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    pointer-events: none;
    text-align: center;
    padding: 2px;
    line-height: 1.1;
}
.ld-reserved {
    background: var(--occupied-border);
    border: 1.5px solid rgba(0,0,0,.15);
}
.popover-banner.pb-reserved {
    background: linear-gradient(135deg, #9CA3AF, #6B7280);
}
.psp-reserved {
    display: inline-flex; align-items: center; gap: 4px;
    background: #E5E7EB; color: #374151;
    font-size: 11.5px; font-weight: 700;
    padding: 3px 9px; border-radius: 999px;
}
.reserved-notice {
    display: flex; align-items: flex-start; gap: 10px;
    background: #F3F4F6;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    padding: 13px 14px;
    color: #374151;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 4px;
}
.reserved-notice svg { flex-shrink: 0; margin-top: 2px; color: #6B7280; }
.reserved-notice-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.reserved-notice-sub   { font-size: 12px; opacity: .85; }
.popover-company-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: 19px; color: var(--ink);
    line-height: 1.15;
}
.popover-company-link {
    font-size: 12.5px; color: var(--standard);
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 2px;
}
.popover-company-link:hover { text-decoration: underline; }

.popover-desc {
    font-size: 13.5px; color: var(--text-muted);
    margin-bottom: 16px;
}

.popover-meta-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 11px 0;
    border-top: 1px solid var(--line);
}
.popover-meta-row:first-of-type { border-top: 1px solid var(--line); margin-top: 2px; }
.popover-meta-label { font-size: 12.5px; color: var(--text-muted); }
.popover-meta-value { font-size: 14px; font-weight: 700; color: var(--ink); }

.popover-status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 700;
    padding: 3px 9px; border-radius: 999px;
}
.psp-available { background: var(--available-bg); color: var(--available); }
.psp-occupied  { background: #6B7280; color: #fff; }

.popover-actions { margin-top: 16px; }

/* Enquire button */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font-family: inherit;
    font-size: 14px; font-weight: 700;
    padding: 11px 16px;
    border-radius: 9px;
    border: none;
    cursor: pointer;
    transition: background .15s, color .15s, transform .1s, box-shadow .15s;
    width: 100%;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }



/* ──────────────────────────────────────────
   ERROR / EMPTY STATES
────────────────────────────────────────── */
.error-banner {
    max-width: 1480px; margin: 14px auto 0; padding: 0 28px;
}
.error-banner-inner {
    background: #FDECEC;
    border: 1px solid #F3B9B9;
    color: #9B2C2C;
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13.5px;
    display: none;
}
.error-banner-inner.show { display: block; }

/* ──────────────────────────────────────────
   FOOTER
────────────────────────────────────────── */
.viewer-footer {
    text-align: center;
    padding: 18px 20px 28px;
    font-size: 12px;
    color: var(--text-faint);
}

/* ──────────────────────────────────────────
   SCROLLBARS (webkit, subtle)
────────────────────────────────────────── */
.booth-list::-webkit-scrollbar,
.map-scroll::-webkit-scrollbar,
.booth-popover::-webkit-scrollbar { width: 9px; height: 9px; }
.booth-list::-webkit-scrollbar-thumb,
.map-scroll::-webkit-scrollbar-thumb,
.booth-popover::-webkit-scrollbar-thumb {
    background: #D8D4C8; border-radius: 5px;
}
.booth-list::-webkit-scrollbar-track,
.map-scroll::-webkit-scrollbar-track,
.booth-popover::-webkit-scrollbar-track { background: transparent; }

/* ──────────────────────────────────────────
   RESPONSIVE
────────────────────────────────────────── */
@media (max-width: 640px) {
    .viewer-header { padding: 18px 16px 16px; }
    .header-title { font-size: 27px; }
    .header-stats { gap: 14px; }
    .hstat-num { font-size: 21px; }
    .legend-strip { padding: 10px 16px; }
    .viewer-body { padding: 16px 16px 40px; gap: 16px; }
    .map-toolbar { padding: 12px; }
    .search-box { width: 150px; }
}

/* ──────────────────────────────────────────
   FOCUS VISIBILITY
────────────────────────────────────────── */
.booth:focus-visible,
.booth-list-row:focus-visible,
.filter-pill:focus-visible,
.zoom-btn:focus-visible,
.btn:focus-visible,
.popover-close:focus-visible,
input:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .booth, .booth-map-container, .booth-popover, .booth-popover-backdrop, .spinner {
        transition: none !important;
        animation: none !important;
    }
}