/* =====================================================
   EXPO BOOTH FLOORPLAN VIEW (public)
   All rules scoped under .expo-booths-page (page root) — the floorplan replaces the booth
   grid when the organizer enables it; interactions mirror the cards exactly.

   Mobile note: the 768px block lives IN THIS FILE — a deliberate, documented deviation from
   the expo-booths-mobile.css split-file convention (a third expo link would create a
   load-order dependency for equal-specificity overrides).

   206: fully tokenized; the few literals below are marked and justified.
   ===================================================== */

.expo-booths-page .expo-floorplan {
    position: relative;
}

/* Width-first stage (owner ruling during testing): the inline plan fills the column and the
   page scrolls — a portrait plan squeezed to 70vh wasted the width. The svg fills the stage
   EXACTLY (tooltip percent coordinates map to the svg box); the svg's intrinsic width/height
   attributes keep the ratio. */
.expo-booths-page .expo-floorplan-stage {
    position: relative;
    width: 100%;
}

.expo-booths-page .expo-floorplan-stage svg {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    background: var(--surface-alt, #f9fafb);
}

/* --- Booth cards (owner ruling: "solid card stickers" — near-opaque cards readable over ANY
       plan artwork; literals below are deliberate: the cards sit on an arbitrary photo, not on
       the theme surface). --- */
.expo-booths-page .expo-floorplan-hotspot {
    transition: fill 0.2s ease, stroke-width 0.2s ease, opacity 0.2s ease;
}

/* Status semantics (owner ruling): traffic-light CARD FILLS — GREEN card = available, runevents
   RED card = occupied. Deliberate literals: status colors over arbitrary plan artwork, never
   theme tokens. */
.expo-booths-page .expo-floorplan-hotspot.free {
    fill: rgba(22, 163, 74, 0.95); /* 206: availability green fill — keep literal */
    stroke: #86EFAC; /* 206: light-green rim lifts the card off any artwork — keep literal */
    stroke-width: 2;
    cursor: pointer;
}

/* Occupied: runevents-red branded card (white logo plate or name). */
.expo-booths-page .expo-floorplan-hotspot.occupied {
    fill: rgba(238, 38, 90, 0.95); /* 206: runevents red = occupied — keep literal */
    stroke: #FDA4BC; /* 206: light-rose rim — keep literal */
    stroke-width: 2;
    cursor: default;
}

/* Reserved: the traffic light's yellow — held, not yet confirmed. Inert (no occupant is ever
   exposed for Reserved booths — R1/R9). */
.expo-booths-page .expo-floorplan-hotspot.reserved {
    fill: rgba(247, 204, 22, 0.95); /* 206: reserved yellow #F7CC16 — keep literal */
    stroke: #FCE588; /* 206: light-amber rim — keep literal */
    stroke-width: 2;
    cursor: default;
}

.expo-booths-page .expo-floorplan-card-label.reserved {
    fill: #1f2937; /* 206: dark text on the yellow card — keep literal */
    stroke: rgba(255, 255, 255, 0.4); /* 206: light halo suits the dark-on-yellow text — keep literal */
}

/* Tooltip pill variant for Reserved (grid vocabulary extension). */
.expo-booths-page .expo-booths-card-status.reserved {
    background: rgba(247, 204, 22, 0.2); /* 206: reserved yellow tint — keep literal */
    color: #B58900; /* 206: amber text — keep literal */
}

.expo-booths-page .expo-floorplan-hotspot.occupied.linkable {
    cursor: pointer;
}

/* Card decor (labels, logo plates): inert — every interaction lives on the polygon. */
.expo-booths-page .expo-floorplan-decor {
    pointer-events: none;
    user-select: none;
}

.expo-booths-page .expo-floorplan-card-label {
    text-anchor: middle;
    dominant-baseline: central;
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-weight: 700;
}

.expo-booths-page .expo-floorplan-card-label.free,
.expo-booths-page .expo-floorplan-card-label.occupied {
    fill: #ffffff; /* 206: white text on the green/red status cards — keep literal */
    paint-order: stroke;
    stroke: rgba(0, 0, 0, 0.25); /* 206: legibility halo on saturated fills — keep literal */
    stroke-width: 2px;
}

.expo-booths-page .expo-floorplan-logo-plate {
    fill: #ffffff; /* 206: logo plate — logos are designed for light grounds — keep literal */
}

/* Hover/focus: lift + a glow in the booth's own status color. */
.expo-booths-page .expo-floorplan-hotspot.free.hovered,
.expo-booths-page .expo-floorplan-hotspot.free:hover,
.expo-booths-page .expo-floorplan-hotspot.free:focus-visible {
    outline: none;
    stroke-width: 4.5;
    filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.55)); /* 206: green glow — keep literal */
}

.expo-booths-page .expo-floorplan-hotspot.occupied.hovered,
.expo-booths-page .expo-floorplan-hotspot.linkable:hover,
.expo-booths-page .expo-floorplan-hotspot.occupied:focus-visible {
    outline: none; /* :focus-visible draws an AABB outline that breaks on rotated booths */
    stroke-width: 4;
    filter: drop-shadow(0 0 10px rgba(238, 38, 90, 0.55)); /* 206: runevents-red glow — keep literal */
}

/* Filter semantics: never hidden, only ghosted — the plan stays whole. Non-matching cards go
   frosted (blur + desaturate + fade, polygon and decor together) so matching booths pop crisp. */
.expo-booths-page .expo-floorplan-booth {
    transition: opacity 0.25s ease, filter 0.25s ease;
}

/* The filter goes on the SHAPES, never the <g>: Chromium paints a filtered group containing
   clipPaths as a black box on some GPUs. */
.expo-booths-page .expo-floorplan-booth.dimmed {
    opacity: 0.45;
    pointer-events: none; /* a ghosted booth is not a click target while filtered out */
}

.expo-booths-page .expo-floorplan-booth.dimmed .expo-floorplan-hotspot,
.expo-booths-page .expo-floorplan-booth.dimmed .expo-floorplan-card-label,
.expo-booths-page .expo-floorplan-booth.dimmed .expo-floorplan-logo-plate,
.expo-booths-page .expo-floorplan-booth.dimmed image {
    filter: blur(3px) saturate(0.3) brightness(0.85);
}

/* --- Hover mini-card: a floating booth card, not a generic tooltip --- */
.expo-booths-page .expo-floorplan-tooltip {
    position: absolute;
    transform: translate(-50%, calc(-100% - 14px));
    max-width: 260px;
    min-width: 150px;
    padding: 0.75rem;
    /* The card gradient recipe from .expo-booths-card, so it reads as a floating booth card. */
    background: linear-gradient(
        160deg,
        color-mix(in srgb, var(--primary-color, #6A4A9E) 4%, var(--surface, #ffffff)) 0%,
        var(--surface, #ffffff) 55%,
        color-mix(in srgb, var(--accent-color, #7BCED7) 5%, var(--surface, #ffffff)) 100%
    );
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--primary-color, #6A4A9E) 25%, transparent);
    pointer-events: none;
    /* Owner ruling: smart placement AND brute-force stacking — above every page surface
       (flyouts 1000, pickers 3000) except the NotificationModal (9999). */
    z-index: 9900;
}

/* Edge-aware placement (set from the booth's normalized position): top-row booths open BELOW,
   edge booths anchor inward, so the card never leaves the stage/viewport. */
.expo-booths-page .expo-floorplan-tooltip.pos-below {
    transform: translate(-50%, 14px);
}

.expo-booths-page .expo-floorplan-tooltip.pos-left {
    transform: translate(-8px, calc(-100% - 14px));
}

.expo-booths-page .expo-floorplan-tooltip.pos-right {
    transform: translate(calc(-100% + 8px), calc(-100% - 14px));
}

.expo-booths-page .expo-floorplan-tooltip.pos-below.pos-left {
    transform: translate(-8px, 14px);
}

.expo-booths-page .expo-floorplan-tooltip.pos-below.pos-right {
    transform: translate(calc(-100% + 8px), 14px);
}

.expo-booths-page .expo-floorplan-tooltip-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
}

.expo-booths-page .expo-floorplan-tooltip-name {
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    overflow-wrap: anywhere;
}

.expo-booths-page .expo-floorplan-tooltip-size {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary, #4B5563);
}

.expo-booths-page .expo-floorplan-tooltip-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.expo-booths-page .expo-floorplan-tooltip-pill {
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--tier-color, color-mix(in srgb, var(--community-primary, #6A4A9E) 12%, transparent));
    color: var(--tier-text, var(--community-primary, #6A4A9E));
}

.expo-booths-page .expo-floorplan-tooltip-occupant {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border, #e5e7eb);
    font-size: 0.8rem;
    color: var(--text-secondary, #4B5563);
}

.expo-booths-page .expo-floorplan-tooltip-occupant img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

/* Company logo AS the headline (occupied tooltips) — it replaces the name text. */
.expo-booths-page .expo-floorplan-tooltip-logo {
    height: 38px;
    width: auto;
    max-width: 170px;
    object-fit: contain;
    border-radius: 6px;
    background: #ffffff; /* 206: logo plate — logos are designed for light grounds — keep literal */
    padding: 3px 6px;
}

/* --- Expand affordance (inline mode) --- */
.expo-booths-page .expo-floorplan-expand {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: var(--surface, #ffffff);
    color: var(--community-primary, #6A4A9E);
    cursor: pointer;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--primary-color, #6A4A9E) 12%, transparent);
    z-index: 2;
}

.expo-booths-page .expo-floorplan-expand:hover {
    background: color-mix(in srgb, var(--community-primary, #6A4A9E) 8%, var(--surface, #ffffff));
}

.expo-booths-page .expo-floorplan-expand:focus-visible {
    outline: 2px solid var(--community-primary, #6A4A9E);
    outline-offset: 2px;
}

/* --- Mobile preview (interactive inline hidden under 768px; tap opens the modal) --- */
.expo-booths-page .expo-floorplan-preview {
    display: none;
}

/* --- Fullscreen modal: the stacking rule lives on the OVERLAY — the booth detail panel's
   overlay (z 1000, connections.css) must always win above the floorplan modal. --- */
.meeting-form-overlay.expo-floorplan-modal-overlay {
    z-index: 990; /* below the detail panel's 1000 so booking opens on top */
}

.meeting-form-popup.expo-floorplan-modal {
    max-width: min(96vw, 1400px);
    width: 100%;
    height: 92vh;
    padding: 1rem;
    align-items: stretch;
    text-align: left;
}

.expo-floorplan-modal .expo-floorplan {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* The zoomwrap is the tooltip's containing block — inline it's transparent (100% width); in the
   modal its width IS the zoom level (100/150/200/300%), and the stage scrolls both axes. */
.expo-booths-page .expo-floorplan-zoomwrap {
    position: relative;
    width: 100%;
}

/* Modal: WIDTH-FIRST (owner ruling) — the plan fills the popup's width and scrolls natively
   down to the lower floors; the zoom buttons scale the zoomwrap. The svg fills the zoomwrap
   exactly, so the tooltip's percent anchoring stays true at every scroll position and zoom. */
.expo-floorplan-modal .expo-floorplan-stage {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: auto;
    overscroll-behavior: contain; /* the page behind must not scroll along */
}

/* Drag-to-scroll affordance (set by the interop in modal mode). */
.expo-floorplan-modal .expo-floorplan-stage.drag-scroll {
    cursor: grab;
}

.expo-floorplan-modal .expo-floorplan-stage.drag-scroll.dragging {
    cursor: grabbing;
    user-select: none;
}

.expo-floorplan-modal .expo-floorplan-stage svg {
    width: 100%;
    height: auto;
    max-height: none;
}

/* Zoom controls (modal only) — 44px targets, community vocabulary. */
.expo-floorplan-modal .expo-floorplan-zoom {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.375rem;
    z-index: 3;
}

.expo-floorplan-modal .expo-floorplan-zoom button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: var(--surface, #ffffff);
    color: var(--community-primary, #6A4A9E);
    cursor: pointer;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--primary-color, #6A4A9E) 12%, transparent);
}

.expo-floorplan-modal .expo-floorplan-zoom button:hover:not(:disabled) {
    background: color-mix(in srgb, var(--community-primary, #6A4A9E) 8%, var(--surface, #ffffff));
}

.expo-floorplan-modal .expo-floorplan-zoom button:disabled {
    opacity: 0.4;
    cursor: default;
}

.expo-floorplan-modal .expo-floorplan-zoom button:focus-visible {
    outline: 2px solid var(--community-primary, #6A4A9E);
    outline-offset: 2px;
}

.expo-floorplan-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    background: var(--surface, #ffffff);
    color: var(--text-secondary, #4B5563);
    cursor: pointer;
    z-index: 2;
}

.expo-floorplan-modal-close:focus-visible {
    outline: 2px solid var(--community-primary, #6A4A9E);
    outline-offset: 2px;
}

/* --- Fallback strip heading ("Also available") — the uppercase mini-heading recipe of
   .expo-booths-filter-title, so the strip reads native to the page. --- */
.expo-booths-page .expo-floorplan-also-title {
    margin: 2rem 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #4B5563);
}

/* --- Booth-name search input (sidebar) — a per-feature copy of the sponsors search recipe
   (house convention: prefixed copies, never cross-file class sharing). --- */
.expo-booths-page .expo-booths-search-wrap {
    position: relative;
    margin-bottom: 0.75rem;
}

.expo-booths-page .expo-booths-search-wrap i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary, #4B5563);
    pointer-events: none;
}

.expo-booths-page .expo-booths-search-input {
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-primary, #1f2937);
    background: var(--surface, #ffffff);
}

.expo-booths-page .expo-booths-search-input:focus {
    outline: none;
    border-color: var(--community-primary, #6A4A9E);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--community-primary, #6A4A9E) 15%, transparent);
}

/* --- Mobile: the plan modal goes truly FULL-SCREEN (owner ruling) — no popup margins, plan
       width-first, native scroll + drag + pinch, thumb-sized zoom buttons. --- */
@media (max-width: 768px) {
    .meeting-form-overlay.expo-floorplan-modal-overlay {
        padding: 0;
    }

    .meeting-form-popup.expo-floorplan-modal {
        max-width: none;
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
        padding: 0.5rem;
    }

    .expo-floorplan-modal .expo-floorplan-stage svg {
        border-radius: 0;
    }

    .expo-floorplan-modal .expo-floorplan-zoom {
        bottom: 1.25rem;
        right: 1.25rem;
    }

    .expo-floorplan-modal .expo-floorplan-zoom button {
        width: 52px;
        height: 52px;
        font-size: 1.1rem;
    }
}

/* --- Mobile: interactive inline off, static preview on --- */
@media (max-width: 768px) {
    .expo-booths-page .expo-floorplan.inline-mode {
        display: none;
    }

    .expo-booths-page .expo-floorplan-preview {
        display: block;
        position: relative;
        width: 100%;
        padding: 0;
        border: 1px solid var(--border, #e5e7eb);
        border-radius: 12px;
        overflow: hidden;
        background: var(--surface-alt, #f9fafb);
        cursor: pointer;
    }

    .expo-booths-page .expo-floorplan-preview img {
        display: block;
        width: 100%;
        height: auto;
        max-height: 50vh;
        object-fit: contain;
    }

    .expo-booths-page .expo-floorplan-preview-label {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        min-height: 44px;
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--community-primary, #6A4A9E);
        background: var(--surface, #ffffff);
        border-top: 1px solid var(--border, #e5e7eb);
    }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .expo-booths-page .expo-floorplan-hotspot,
    .expo-booths-page .expo-floorplan-booth {
        transition: none;
    }
}
