/*
 * The hall seat map.
 *
 * Shared by the customer reservation page and the backoffice reschedule page so
 * the two cannot drift: a seat that reads as taken to staff has to look the same
 * to the customer who is about to be told it is taken.
 *
 * Markup the rules expect, built by js/seat_map.js:
 *   .hall-scroll > #seat-map[style="--cols: n"] > .hall-row
 *     > .row-badge, .hall-row-seats > .seat.<state>[.type-<type>], .row-badge
 */

/* The hall scrolls sideways on small screens instead of squeezing the rows. */
.hall-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 6px 4px;
    background: #fbfbfc;
    border: 1px solid #eceef1;
    border-radius: 14px;
}

#seat-map {
    --seat: 38px;
    --gap: 4px;
    display: table;
    margin: 0 auto;
}

.hall-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--gap);
}

.hall-row-seats {
    display: grid;
    grid-template-columns: repeat(var(--cols), var(--seat));
    gap: var(--gap);
}

.row-badge {
    width: calc(var(--seat) * 0.62);
    text-align: center;
    font-size: calc(var(--seat) * 0.3);
    font-weight: 700;
    color: #9aa0ab;
    flex-shrink: 0;
}

.seat {
    height: calc(var(--seat) * 0.84);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--seat) * 0.26);
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    border-radius: 7px 7px 3px 3px;
    /* the pale strip along the top reads as the seat back */
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .22) 0 30%, rgba(255, 255, 255, 0) 30%);
    background-color: #3e6690;
    transition: transform .1s ease, background-color .1s ease;
}

.seat.available:hover {
    background-color: #5480ad;
    transform: translateY(-1px);
}

.seat.selected {
    background-color: #e8c468;
    color: #4a3706;
    box-shadow: 0 0 0 2px #c79a2b inset;
}

.seat.booked {
    background-color: #b8443a;
    color: #ffe9e6;
    cursor: not-allowed;
}

.seat.type-vip {
    background-color: #cb9b3f;
    color: #3a2a08;
}

.seat.type-vip.available:hover {
    background-color: #dcb05a;
}

/* Drawn as the curve the rows face, so it reads as the screen and not a seat. */
.hall-screen {
    margin: 22px auto 0;
    max-width: 60%;
    min-width: 180px;
    height: 16px;
    background: linear-gradient(180deg, #dfe7f2, #f4f7fb);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
    box-shadow: 0 -6px 18px rgba(120, 150, 190, .35);
}

.hall-screen-label {
    margin: 6px 0 0;
    text-align: center;
    letter-spacing: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #9aa0ab;
}

.hall-hint {
    margin: 8px 0 0;
    color: #9aa0ab;
}

@media (max-width: 992px) {
    #seat-map { --seat: 30px; --gap: 3px; }
}

@media (max-width: 600px) {
    #seat-map { --seat: 24px; --gap: 2px; }

    .hall-row { gap: 6px; }

    .seat { border-radius: 5px 5px 2px 2px; }

    .seat-key { gap: 10px; font-size: 12px; }

    .seat-key .seat-count { margin-left: 0; width: 100%; }
}

.seat-key {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-top: 14px;
    font-size: 13px;
}

.seat-key .key {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: -2px;
}

.seat-key .key.available { background: #3e6690; }
.seat-key .key.selected { background: #e8c468; }
.seat-key .key.booked { background: #c0392b; }
.seat-key .key.held { background: #9b7fb5; }
.seat-key .key.closed { background: #d9d9d9; }
.seat-key .key.vip { background: #cb9b3f; }

.seat-key .seat-count {
    margin-left: auto;
    font-weight: 600;
}

/* Someone else is part-way through paying for it. Not sold yet, but not
   offerable either, so it is distinct from both. */
.seat.held {
    background-color: #9b7fb5;
    color: #f3ecf8;
    cursor: not-allowed;
}

/* Taken off sale in the backoffice, as opposed to sold. */
.seat.closed {
    background: #d9d9d9;
    border-radius: 6px;
    color: #8a8a8a;
    cursor: not-allowed;
}

.seat.type-vip {
    box-shadow: inset 0 0 0 2px #cb9b3f;
    border-radius: 6px;
}
