/* ── Seating Plan ─────────────────────────────────────────────────────────── */

.seating-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem 0.5rem;
    flex-wrap: wrap;
}

.seating-dropdown-wrapper {
    position: relative;
}

.seating-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    min-width: 170px;
    margin-top: 4px;
}

.seating-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.55rem 1rem;
    border: none;
    background: none;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--color-text);
}

.seating-dropdown button:hover {
    background: var(--color-bg-disabled);
}

.seating-dropdown button:first-child { border-radius: 8px 8px 0 0; }
.seating-dropdown button:last-child { border-radius: 0 0 8px 8px; }

.seating-dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0.2rem 0;
}

.seating-dropdown-danger { color: var(--color-danger) !important; }
.seating-dropdown-danger:hover { background: rgba(255, 59, 48, 0.08) !important; }

/* ── Unseated guests bar ─────────────────────────────────────────────────── */

.seating-unseated {
    padding: 0.5rem 1rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.seating-unseated-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.seating-unseated-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.seating-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--color-border);
    color: var(--color-text);
}

.seating-chip-male {
    background: var(--color-gender-male-bg);
    color: var(--color-gender-male);
    border-color: var(--color-gender-male-border);
}

.seating-chip-female {
    background: var(--color-gender-female-bg);
    color: var(--color-gender-female);
    border-color: var(--color-gender-female-border);
}

.seating-chip:hover { filter: brightness(0.95); }

.seating-chip-selected {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
    box-shadow: 0 0 0 4px rgba(230,168,23,0.2);
}

.seating-none {
    font-size: 0.82rem;
    color: var(--color-placeholder);
    font-style: italic;
}

/* ── Tables container ────────────────────────────────────────────────────── */

.seating-tables {
    padding: 0.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.seating-empty {
    text-align: center;
    color: var(--color-placeholder);
    padding: 2rem 1rem !important;
}

.seating-table-card {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    overflow: hidden;
}

.seating-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.seating-table-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
}

.seating-table-actions {
    display: flex;
    gap: 0.3rem;
}

.seating-action-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--color-text-muted);
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.seating-action-btn:hover { background: var(--color-border); color: var(--color-text-secondary); }
.seating-action-active { color: var(--color-accent) !important; }
.seating-action-danger:hover { color: var(--color-danger); background: rgba(255, 59, 48, 0.08); }

/* ── SVG ─────────────────────────────────────────────────────────────────── */

.seating-svg-wrap {
    padding: 1rem;
    display: flex;
    justify-content: center;
    overflow-x: auto;
}

.seating-svg {
    max-width: 100%;
    height: auto;
    min-height: 120px;
}

.seating-seat { transition: opacity 0.15s; }

.seating-seat-empty:hover circle {
    fill: var(--color-border);
    stroke: var(--color-text-muted);
}

.seating-seat-highlight circle {
    fill: var(--color-accent-pale) !important;
    stroke: var(--color-accent) !important;
    stroke-dasharray: none !important;
}

.seating-seat-filled:hover circle { filter: brightness(0.92); }

.seating-seat-swap-highlight circle {
    stroke: var(--color-accent) !important;
    stroke-width: 3 !important;
}

/* ── Drag-and-drop ──────────────────────────────────────────────────────── */
.seating-drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1.5px solid transparent;
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.seating-dragging {
    user-select: none;
    -webkit-user-select: none;
}

.seating-dragging .seating-seat { pointer-events: all; }

.seating-seat-drop-target circle {
    fill: var(--color-accent-pale) !important;
    stroke: var(--color-accent) !important;
    stroke-dasharray: none !important;
    animation: seating-drop-pulse 1s ease-in-out infinite;
}

@keyframes seating-drop-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.seating-chip[draggable="true"] {
    cursor: grab;
}

.seating-chip[draggable="true"]:active {
    cursor: grabbing;
}

.seating-seat-locked circle {
    stroke-width: 3 !important;
}

/* ── Action circles (unseat X + lock) ────────────────────────────────────── */

.seating-action-circles {
    pointer-events: none;
}

.seating-action-circle {
    pointer-events: auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--color-placeholder);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    padding: 0;
}

.seating-action-circle:hover { transform: scale(1.1); }

.seating-action-circle-x {
    border-color: var(--color-danger);
    color: var(--color-danger);
}
.seating-action-circle-x:hover { background: rgba(255, 59, 48, 0.08); }

.seating-action-circle-lock {
    border-color: var(--color-placeholder);
    color: var(--color-text-muted);
}
.seating-action-circle-lock:hover { background: var(--color-bg-disabled); }

.seating-action-circle-locked {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-accent-pale);
}

/* ── Shape picker (modal) ────────────────────────────────────────────────── */

.seating-shape-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.seating-shape-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 0.4rem;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.seating-shape-option:hover {
    border-color: var(--color-placeholder);
    background: var(--color-bg-secondary);
}

.seating-shape-option.active {
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}

.seating-shape-icon {
    width: 64px;
    height: 48px;
}

.seating-shape-option span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.seating-shape-option.active span {
    color: var(--color-primary);
}

/* ── Modal preview ───────────────────────────────────────────────────────── */

.seating-modal-preview {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
}

.seating-modal-preview .seating-svg {
    max-height: 140px;
}

/* ── Picker modal ────────────────────────────────────────────────────────── */

.seating-picker-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.seating-picker-item {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: filter 0.15s;
    border: 1.5px solid transparent;
    background: var(--color-border);
    color: var(--color-text);
}

.seating-picker-item:hover { filter: brightness(0.93); }

.seating-picker-item.seating-chip-male {
    background: var(--color-gender-male-bg);
    color: var(--color-gender-male);
    border-color: var(--color-gender-male-border);
}

.seating-picker-item.seating-chip-female {
    background: var(--color-gender-female-bg);
    color: var(--color-gender-female);
    border-color: var(--color-gender-female-border);
}


/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .seating-toolbar { padding: 0.5rem 0.75rem; }
    .seating-unseated { padding: 0.5rem 0.75rem; }
    .seating-tables { padding: 0.5rem 0.75rem; }
    .seating-svg-wrap { padding: 0.75rem 0.25rem; }
    .seating-shape-option { padding: 0.5rem 0.25rem; min-width: calc(50% - 0.5rem); }
    .seating-shape-icon { width: 52px; height: 40px; }
}

/* ── Seating instructions ────────────────────────────────────────────────── */
.seating-instructions {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    background: var(--color-bg-secondary);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    line-height: 1.5;
}
.seating-instructions strong {
    color: var(--color-text);
}
.seating-instructions ul {
    margin: 0.3rem 0 0;
    padding-left: 1.2rem;
}
.seating-instructions li {
    margin-bottom: 0.15rem;
}

/* Show desktop instructions by default, hide mobile */
.seating-instructions-mobile { display: none; }

/* On touch/small screens: show mobile, hide desktop */
@media (pointer: coarse) {
    .seating-instructions-desktop { display: none; }
    .seating-instructions-mobile { display: block; }
}
@media (max-width: 768px) {
    .seating-instructions-desktop { display: none; }
    .seating-instructions-mobile { display: block; }
}
