/* ============================================
   Custom Seat Select Component
   ============================================ */

/* --- Tier Colors --- */
:root {
    --seat-light-color: #6B7280;
    --seat-light-bg: #F3F4F6;
    --seat-light-border: #D1D5DB;

    --seat-base-color: #059669;
    --seat-base-bg: #ECFDF5;
    --seat-base-border: #A7F3D0;

    --seat-pro-color: #D97706;
    --seat-pro-bg: #FFFBEB;
    --seat-pro-border: #FDE68A;

    --seat-admin-color: #7C3AED;
    --seat-admin-bg: #F5F3FF;
    --seat-admin-border: #C4B5FD;
}

/* --- Container --- */
.seat-select {
    position: relative;
    min-width: 200px;
    font-size: var(--font-size-sm);
    user-select: none;
}

/* --- Trigger Button --- */
.seat-select__trigger {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0 var(--space-xxs);
    padding-right: 35px;
    border: 1px solid var(--clr-grey-200);
    border-radius: var(--radius-xl);
    background: var(--clr-white);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-height: 34px;
    width: 100%;
    position: relative;
}

.seat-select__trigger:hover {
    border-color: var(--clr-brand-primary);
}

/* Focus state with outline */
.seat-select:focus, select:active, .seat-select:focus-visible, select:focus-within, .seat-select:visited {
  border-color: var(--clr-brand-primary);
  outline-color: var(--clr-brand-primary);
}

.seat-select.open .seat-select__trigger {
    border-color: var(--clr-brand-primary);
    box-shadow: 0 0 0 2px rgba(86, 133, 191, 0.15);
}

/* Chevron arrow */
.seat-select__trigger::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A5A5A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease;
}

.seat-select.open .seat-select__trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

/* --- Trigger Content --- */
.seat-select__label {
    color: var(--font-clr-light);
}

.seat-select__value {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Dropdown Panel (portaled to document.body) --- */
.seat-select__dropdown {
    position: fixed;
    background: var(--clr-white);
    border: 1.5px solid var(--clr-grey-200);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
}

.seat-select__dropdown--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* --- Option Items --- */
.seat-select__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.seat-select__option:hover {
    background-color: var(--clr-grey-50);
}

.seat-.select__optionseat-selected {
    background-color: var(--clr-grey-100);
}

.seat-select__option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.seat-select__option.disabled:hover {
    background-color: transparent;
}

.seat-select__option--none {
    color: var(--font-clr-light);
}

/* --- Seat Badge (icon + text pill) --- */
.seat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px 2px 6px;
    border-radius: var(--radius-full);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-xs);
    line-height: 1.6;
    border: 1.5px solid transparent;
    white-space: nowrap;
    width: 100%;
}

.seat-badge__icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* --- Tier: Light --- */
.seat-badge--light {
    color: var(--seat-light-color);
    background-color: var(--seat-light-bg);
    border-color: var(--seat-light-border);
}

/* --- Tier: Base (green) --- */
.seat-badge--base {
    color: var(--seat-base-color);
    background-color: var(--seat-base-bg);
    border-color: var(--seat-base-border);
}

/* --- Tier: Pro (gold) --- */
.seat-badge--pro {
    color: var(--seat-pro-color);
    background-color: var(--seat-pro-bg);
    border-color: var(--seat-pro-border);
}

/* --- Tier: Admin (diamond / purple) --- */
.seat-badge--admin {
    color: var(--seat-admin-color);
    background-color: var(--seat-admin-bg);
    border-color: var(--seat-admin-border);
}

/* --- Availability Count --- */
.seat-select__avail {
    margin-left: auto;
    font-size: var(--font-size-xxs);
    color: var(--font-clr-muted);
    white-space: nowrap;
}

.seat-select__avail--zero {
    color: var(--clr-danger);
}

.seat-select__avail--current {
    color: var(--clr-brand-primary);
    font-style: italic;
}

/* --- Separator --- */
.seat-select__separator {
    height: 1px;
    background-color: var(--clr-grey-150);
    margin: 4px 6px;
}
