/* ============================================================================
 * EXPO BOOTH RESERVATION PAGE
 * Overview: per-partnership-level sections with booth cards + multi-select
 * filter sidebar whose entries expand to the package's items and prices.
 * All rules scoped under .expo-booths-page for specificity.
 * ============================================================================ */

/* --- Page Layout --- */
.expo-booths-page {
    display: flex;
    gap: var(--spacing-xl, 2rem);
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg, 1.5rem) 0;
}

.expo-booths-page.search-right {
    flex-direction: row-reverse;
}

/* --- Sidebar / Filter Panel --- */
.expo-booths-page .expo-booths-sidebar {
    flex: 0 0 260px;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    margin-top: 12px;
}

.expo-booths-page .expo-booths-sidebar-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.expo-booths-page .expo-booths-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.expo-booths-page .expo-booths-filter-title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-primary, #1f2937);
}

.expo-booths-page .expo-booths-filter-clear {
    border: none;
    background: transparent;
    padding: 0.25rem 0.375rem;
    min-height: 44px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--community-primary, #6A4A9E);
    transition: background-color 0.15s ease;
}

.expo-booths-page .expo-booths-filter-clear:hover {
    text-decoration: underline;
}

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

/* --- Package Filter List (checkbox + colored right border, like sponsors labels) --- */
.expo-booths-page .expo-booths-package-filters {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.expo-booths-page .expo-booths-filter-row {
    display: flex;
    align-items: stretch;
}

.expo-booths-page .expo-booths-filter-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.375rem;
    min-height: 44px;
    cursor: pointer;
    border-right: 4px solid transparent;
    transition: background-color 0.15s ease;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-primary, #1f2937);
    user-select: none;
}

.expo-booths-page .expo-booths-filter-item:hover {
    background: var(--surface-alt);
}

.expo-booths-page .expo-booths-filter-item.active {
    background: color-mix(in srgb, var(--primary-color) 4%, transparent);
}

.expo-booths-page .expo-booths-filter-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    cursor: pointer;
    accent-color: var(--community-primary, #6A4A9E);
    margin: 0;
}

.expo-booths-page .expo-booths-filter-item span {
    flex: 1;
    font-weight: 400;
}

/* --- Items Accordion (expand button + rotating chevron, like agenda categories) --- */
.expo-booths-page .expo-booths-filter-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary, #4B5563);
    transition: background-color 0.15s;
}

.expo-booths-page .expo-booths-filter-expand:hover {
    background: var(--surface-alt);
}

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

.expo-booths-page .expo-booths-filter-chevron {
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

.expo-booths-page .expo-booths-filter-package.open .expo-booths-filter-chevron {
    transform: rotate(180deg);
}

.expo-booths-page .expo-booths-filter-package-items {
    padding: 0.375rem 0.5rem 0.625rem;
    animation: expo-booths-expand 0.25s ease;
}

@keyframes expo-booths-expand {
    from { opacity: 0; }
    to { opacity: 1; }
}

.expo-booths-page .expo-booths-filter-package-price {
    margin: 0 0 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.expo-booths-page .expo-booths-filter-items-title {
    margin: 0 0 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--community-primary, #6A4A9E);
}

.expo-booths-page .expo-booths-filter-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.expo-booths-page .expo-booths-filter-items-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary, #4B5563);
}

.expo-booths-page .expo-booths-filter-item-price {
    white-space: nowrap;
    color: var(--text-primary, #1f2937);
}

/* --- Main Content Area --- */
.expo-booths-page .expo-booths-main {
    flex: 1;
    min-width: 0;
}

/* --- Result Count (aria-live announcement) --- */
.expo-booths-page .expo-booths-result-count {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary, #4B5563);
}

/* --- Level Section Headers (centered pill, matches sponsors tier pill) --- */
.expo-booths-page .expo-booths-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    margin: 1.5rem auto 0.75rem;
    width: fit-content;
    border-radius: 100px;
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-size: var(--font-size-xs, 0.7rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--tier-color, var(--community-primary, #6A4A9E));
    color: var(--tier-text, #fff);
}

.expo-booths-page .expo-booths-section-header:first-of-type {
    margin-top: 0;
}

/* --- Booth Cards Grid --- */
.expo-booths-page .expo-booths-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 0;
}

/* --- Booth Card --- */
.expo-booths-page .expo-booths-card {
    display: flex;
    flex-direction: column;
    width: 210px;
    /* Uniform height with or without an occupant row — the occupant block anchors to the
       bottom via margin-top: auto, so logo-less cards keep the same footprint. */
    min-height: 172px;
    padding: 1rem;
    background: linear-gradient(
        160deg,
        color-mix(in srgb, var(--primary-color) 4%, transparent) 0%,
        var(--surface-alt) 55%,
        color-mix(in srgb, var(--accent-color) 5%, transparent) 100%
    );
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow:
        0 2px 4px color-mix(in srgb, var(--primary-color) 2%, transparent),
        0 4px 8px color-mix(in srgb, var(--primary-color) 2%, transparent);
}

.expo-booths-page .expo-booths-card.free {
    cursor: pointer;
}

.expo-booths-page .expo-booths-card.free:hover {
    transform: translateY(-2px);
    z-index: 2;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--primary-color) 25%, transparent);
}

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

.expo-booths-page .expo-booths-card.occupied {
    background: var(--surface-alt);
    cursor: default;
}

/* Occupied card with a click-through destination (occupant subpage or website) — same
   affordance as a free card. */
.expo-booths-page .expo-booths-card.occupied.linkable {
    cursor: pointer;
}

.expo-booths-page .expo-booths-card.occupied.linkable:hover {
    transform: translateY(-2px);
    z-index: 2;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--primary-color) 25%, transparent);
}

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

/* --- Card Header (status chip stacked ABOVE the name — the name gets the full width) --- */
.expo-booths-page .expo-booths-card-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
}

.expo-booths-page .expo-booths-card-name {
    font-family: "IBM Plex Sans Condensed", sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    background: linear-gradient(45deg, var(--community-primary, #6A4A9E), var(--community-accent, #7BCED7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    overflow-wrap: anywhere;
}

.expo-booths-page .expo-booths-card.occupied .expo-booths-card-name {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--text-secondary, #4B5563);
}

/* --- Status Chip --- */
.expo-booths-page .expo-booths-card-status {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.1875rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.expo-booths-page .expo-booths-card-status.free {
    background: color-mix(in srgb, var(--community-primary, #6A4A9E) 12%, transparent);
    color: var(--community-primary, #6A4A9E);
}

.expo-booths-page .expo-booths-card-status.occupied {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary, #4B5563);
}

/* --- Card Size Line --- */
.expo-booths-page .expo-booths-card-size {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary, #4B5563);
}

/* --- Occupant Row (only with ShowSignedUpCompanies + API occupant data) --- */
.expo-booths-page .expo-booths-card-occupant {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.expo-booths-page .expo-booths-card-occupant-logo {
    width: 28px;
    height: 28px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.expo-booths-page .expo-booths-card-occupant-name {
    font-size: 0.75rem;
    color: var(--text-secondary, #4B5563);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Placeholder (loading, empty, error states) --- */
.expo-booths-page .expo-booths-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary, #4B5563);
}

.expo-booths-page .expo-booths-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.expo-booths-page .expo-booths-placeholder p {
    font-size: 1rem;
    margin: 0;
}

/* --- Loading Spinner --- */
.expo-booths-page .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--community-primary, #6A4A9E);
    border-radius: 50%;
    animation: expo-booths-spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

/* =============================================================
   Booth Detail Panel (extends .meeting-form-overlay / .meeting-form-popup
   from connections.css, the same way partnership-meetings.css does)
   ============================================================= */

/* The base popup is 440px; the booking flow's company form needs room. */
.expo-booth-detail-popup {
    max-width: 680px;
}

.expo-booth-detail-popup .expo-booth-detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    margin: 0.6rem 0 1rem 0;
    padding: 0.75rem 1rem;
    width: 100%;
    text-align: left;
    background: color-mix(in srgb, var(--glass-white) 60%, transparent);
    border-radius: 0.5rem;
}

.expo-booth-detail-popup .expo-booth-detail-list > div {
    display: contents;
}

.expo-booth-detail-popup .expo-booth-detail-list dt {
    font-weight: 600;
    color: var(--text-secondary, #4B5563);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.expo-booth-detail-popup .expo-booth-detail-list dd {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary, #1f2937);
}

.expo-booth-detail-popup .expo-booth-detail-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Action rows: the primary CTA leads, the secondary (Close/Back) stays content-sized.
   The base connections.css stretches .connection-btn-secondary to flex: 1, which inverted
   the visual weight against our custom primary — the secondary must never outgrow it. */
.expo-booth-detail-popup .connection-dialog-actions .expo-booth-detail-cta {
    flex: 1;
}

.expo-booth-detail-popup .connection-dialog-actions .connection-btn-secondary {
    flex: 0 0 auto;
}

/* Primary CTA — styled after .sponsor-detail-cta-button (sponsor-detail.css). */
.expo-booth-detail-cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.75rem 1.75rem;
    font-size: var(--font-size-base, 0.95rem);
    font-weight: 700;
    color: var(--primary-color-text);
    background: linear-gradient(
        135deg,
        var(--community-primary, #6A4A9E),
        color-mix(in srgb, var(--community-primary, #6A4A9E) 70%, var(--community-accent, #7BCED7))
    );
    border: none;
    border-radius: 100px;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 12px color-mix(in srgb, var(--community-primary, #6A4A9E) 30%, transparent);
}

.expo-booth-detail-cta::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%, /* shimmer over saturated brand fill — keep literal */
        transparent 100%
    );
    animation: expoBoothCtaShimmer 3s ease-in-out infinite;
}

@keyframes expoBoothCtaShimmer {
    0% { left: -100%; }
    60% { left: 100%; }
    100% { left: 100%; }
}

.expo-booth-detail-cta:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px color-mix(in srgb, var(--community-primary, #6A4A9E) 35%, transparent);
}

.expo-booth-detail-cta:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.expo-booth-detail-cta i {
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.expo-booth-detail-cta:hover:not(:disabled) i {
    transform: translateX(3px);
}

/* =============================================================
   Booking Flow (wizard hosted inside the detail popup)
   ============================================================= */

.expo-booth-flow {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* Compact context heading while the dialog is in booking mode (booth · package) */
.expo-booth-detail-popup .expo-booth-flow-context {
    font-size: 1.05rem;
    color: var(--text-secondary, #4B5563);
    font-weight: 600;
}

.expo-booth-flow-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
}

/* Centered stack for the status states (loading / error / redirect / already assigned) */
.expo-booth-flow-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    text-align: center;
}

.expo-booth-flow-status i {
    font-size: 1.75rem;
    color: var(--community-primary, #6A4A9E);
}

.expo-booth-flow-status p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary, #1f2937);
}

/* Celebratory reserved state — the flow's one green accent (WCAG AA on white) */
.expo-booth-flow-success i {
    color: var(--success, #16A34A);
}

.expo-booth-flow-mailto {
    color: var(--community-primary, #6A4A9E);
    font-weight: 600;
    text-decoration: underline;
    /* 44px touch target on a text link */
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.5rem;
}

/* Read-only notice above the non-editable company data (Q2) */
.expo-booth-flow-notice {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #4B5563);
    text-align: center;
}

/* --- Company Form (linked staff only; meeting-form-* base from connections.css) --- */

.expo-booth-form {
    width: 100%;
    text-align: left;
}

/* The address fieldset groups its inputs under one legend — reset chrome, keep spacing */
.expo-booth-form-address {
    border: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.expo-booth-form-address legend {
    padding: 0;
}

/* Postal code + town + province share one row */
.expo-booth-form-row {
    display: grid;
    grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.375rem;
}

/* Inline required-field error (cf-field-error scheme from surveys.css) */
.expo-booth-field-error {
    color: var(--error, #DC2626);
    font-size: 0.8125rem;
    margin: 0.25rem 0 0 0;
}

/* --- AI Match Picker (identify path: pick the company the matcher found) --- */

.expo-booth-match-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    text-align: left;
}

.expo-booth-match-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    /* 44px touch target on the whole row */
    min-height: 44px;
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 8px;
    cursor: pointer;
}

.expo-booth-match-option:has(input:checked) {
    border-color: var(--community-primary, #6A4A9E);
}

.expo-booth-match-option:focus-within {
    outline: 2px solid var(--community-primary, #6A4A9E);
    outline-offset: 2px;
}

.expo-booth-match-option input {
    accent-color: var(--community-primary, #6A4A9E);
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.expo-booth-match-name {
    font-size: 0.95rem;
    color: var(--text-primary, #1f2937);
    overflow-wrap: anywhere;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .expo-booths-page .expo-booths-card,
    .expo-booths-page .expo-booths-filter-item,
    .expo-booths-page .expo-booths-filter-expand,
    .expo-booths-page .expo-booths-filter-chevron,
    .expo-booths-page .expo-booths-filter-clear {
        transition: none;
    }

    .expo-booths-page .expo-booths-card.free:hover,
    .expo-booths-page .expo-booths-card.occupied.linkable:hover {
        transform: none;
    }

    .expo-booths-page .expo-booths-filter-package-items {
        animation: none;
    }

    .expo-booths-page .loading-spinner {
        animation: none;
    }

    .expo-booth-detail-cta {
        transition: none;
    }

    .expo-booth-detail-cta::after {
        animation: none;
    }

    .expo-booth-detail-cta:hover:not(:disabled) {
        transform: none;
    }

    .expo-booth-detail-cta i {
        transition: none;
    }
}
