/* Seat maps: the SVG keeps its own drawing, only the seats get state colours (Bootstrap 5 variables with fallbacks). */
.cem-seatmap-canvas {
    position: relative;
    overflow: auto;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, .375rem);
    background: var(--bs-body-bg, #fff);
    padding: .5rem;
}
.cem-seatmap-svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
}
.cem-seatmap-svg [data-seat].is-free {
    fill: var(--bs-success-bg-subtle, #d1e7dd) !important;
    stroke: var(--bs-success, #198754) !important;
}
/* Seat numbers drawn on top of the seats must not swallow clicks (the SVG sanitizer drops pointer-events attributes). */
.cem-seatmap-svg text {
    pointer-events: none;
}
.cem-seatmap-svg [data-seat].is-selectable {
    cursor: pointer;
}
/* the selected seat keeps its colour while the pointer is still on it or it has the focus */
.cem-seatmap-svg [data-seat].is-selectable:not(.is-selected):hover,
.cem-seatmap-svg [data-seat].is-selectable:not(.is-selected):focus {
    fill: var(--bs-success, #198754) !important;
    outline: none;
}
.cem-seatmap-svg [data-seat].is-taken {
    fill: var(--bs-secondary-bg, #e9ecef) !important;
    stroke: var(--bs-secondary, #6c757d) !important;
    opacity: .8;
}
.cem-seatmap-svg [data-seat].is-mine {
    fill: var(--bs-primary, #0d6efd) !important;
    stroke: var(--bs-primary, #0d6efd) !important;
}
.cem-seatmap-svg [data-seat].is-selected {
    fill: var(--bs-warning, #ffc107) !important;
    stroke: var(--bs-dark, #212529) !important;
    /* colours only: a wider stroke depends on the map's units (2 units = a 2 mm ring in maps drawn in mm) */
    outline: none;
}
.cem-seatmap-swatch {
    display: inline-block;
    width: .85rem;
    height: .85rem;
    border-radius: 2px;
    vertical-align: -1px;
    border: 1px solid var(--bs-secondary, #6c757d);
}
.cem-seatmap-swatch.is-free { background: var(--bs-success-bg-subtle, #d1e7dd); border-color: var(--bs-success, #198754); }
.cem-seatmap-swatch.is-taken { background: var(--bs-secondary-bg, #e9ecef); }
.cem-seatmap-swatch.is-mine { background: var(--bs-primary, #0d6efd); border-color: var(--bs-primary, #0d6efd); }
.cem-seatmap-swatch.is-selected { background: var(--bs-warning, #ffc107); border-color: var(--bs-dark, #212529); }

/* Taken seats with a known holder: popover with avatar and name (elements/seat_map.php) */
.cem-seatmap-svg [data-holder-name] {
    cursor: pointer;
    outline: none;
}
.cem-seatmap-popover {
    position: absolute;
    z-index: 5;
    transform: translate(-50%, calc(-100% - .5rem));
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .375rem .625rem .375rem .375rem;
    white-space: nowrap;
    pointer-events: none;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, .375rem);
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .25);
}
.cem-seatmap-popover[hidden] {
    display: none;
}
.cem-seatmap-popover-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2rem;
    height: 2rem;
    overflow: hidden;
    border-radius: 50%;
    background: var(--bs-secondary-bg, #e9ecef);
    font-size: .75rem;
    font-weight: 700;
}
.cem-seatmap-popover-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cem-seatmap-popover-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.cem-seatmap-popover-seat {
    color: var(--bs-secondary-color, #6c757d);
}

/* Seat agent chat (elements/seat_agent_chat.php) */
.cem-seat-agent-log { max-height: 26rem; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; }
.cem-seat-agent-msg { max-width: 85%; padding: .5rem .75rem; border-radius: .75rem; background: var(--bs-tertiary-bg, #f1f3f5); white-space: pre-wrap; overflow-wrap: anywhere; }
.cem-seat-agent-msg.is-user { align-self: flex-end; background: var(--bs-primary-bg-subtle, #cfe2ff); }
.cem-seat-agent-msg.is-notice { align-self: center; max-width: 100%; background: var(--bs-warning-bg-subtle, #fff3cd); font-size: .875rem; }
.cem-seat-agent-msg.is-error { background: var(--bs-danger-bg-subtle, #f8d7da); }
.cem-seat-agent-msg.is-waiting .cem-seat-agent-text { opacity: .7; font-style: italic; }
.cem-seat-agent-who { opacity: .7; margin-bottom: .125rem; }
