/*
 * The seat map engine's stylesheet -- the single source of truth for how
 * a hall is drawn.
 *
 * Every surface that shows a seat map loads this file: the admin's
 * showing map, the customer editor's reservation map, the register, the
 * hall template preview, and the Chorus site (which links to it here on
 * answermail.com). Per-hall SECTION POSITIONS stay in the database
 * (concert_hall.concert_css) and are printed beside the map markup; this
 * file holds everything the halls share, so the same positions render
 * the same everywhere.
 *
 * The metrics (10px seats, 2px margins, 10px row labels, sections at
 * font-size 0) are the admin map's original metrics. The database
 * positions were tuned against them, so they cannot change without
 * every hall shifting. Colours and chrome are fair game.
 */

.concert-hall-dimmensions {
	position: relative;
}

.seat-row {
	font-size: 0;
}

.section {
	font-size: 0;
}

.section-label {
	position: absolute;
	font-size: 15px;
}

.seat {
	width: 10px;
	height: 10px;
	margin: 2px;
	display: inline-block;
	vertical-align: top;
	text-align: center;
	font-size: 6px;
	cursor: pointer;
	border: 1px solid #9a9a9a;
	line-height: 10px;
	box-sizing: content-box;
	border-radius: 2px;
}

.seat:hover {
	background-color: #fffde1;
}

/* A label occupies exactly one seat cell (16px of pitch), so the seats
   after it start on a cell boundary and sit centred in the grid. */
.row-label {
	width: 10px;
	height: 10px;
	display: inline-block;
	vertical-align: top;
	margin: 2px 3px;
	text-align: center;
	line-height: 10px;
	font-size: 7px;
	color: #918f8f;
}

.row-spacer {
	height: 14px;
	display: block;
}

/* ---- seating levels (concert_hall_levels.css_class) ---- */

.general    { background-color: #3d8e61; border-color: #357953; color: #fff; }
.premium,
.premo      { background-color: #f28d1d; border-color: #d97c12; color: #fff; }
.levelA     { background-color: #e1f0fb; border-color: #adcdec; }
.levelB     { background-color: #adcdec; border-color: #79b6e4; }
.levelC     { background-color: #79b6e4; border-color: #5a9fd4; }
.levelPRM   { background-color: #065eae; border-color: #065eae; color: #fff; }
.sectionA   { background-color: #ffcf40; border-color: #e6b929; }
.sectionB   { background-color: #5ebd6a; border-color: #4da659; }
.sectionC   { background-color: #f47a5c; border-color: #dd6549; }
.sectionCH  { background-color: #c00000; border-color: #a30000; color: #fff; }

/* ---- seat states. Declared after the levels so a sold seat looks sold
        whatever level class it also carries. ---- */

/* Sold, or otherwise not available. */
.seat.reserved {
	background-color: #c8c8c8;
	border-color: #b4b4b4;
	color: #6d6d6d;
	cursor: default;
}

/* Held in someone's cart but not paid for. */
.seat.reserved-live {
	background-color: #2f6fd0;
	border-color: #2358a8;
	color: #fff;
}

/* Held in THIS session's cart. */
.seat.reserved-session {
	background-color: #d9251d;
	border-color: #b21a14;
	color: #fff;
}

/* Belongs to the customer being worked on. */
.seat.customer-seat {
	background-color: #8ae234;
	border-color: #6db427;
	color: #234308;
}

/* ---- hall graphics (hall_decor): drawn by the engine inside
        .concert-hall-dimmensions on every surface ---- */

.hall-decor {
	position: absolute;
	user-select: none;
	pointer-events: none;
	color: #8a8a8a;
}

.hall-decor-stage {
	height: 22px;
	min-width: 120px;
	line-height: 22px;
	text-align: center;
	font-size: 11px;
	letter-spacing: 3px;
	background: #dedede;
	color: #666;
	border-radius: 4px;
}

.hall-decor-entrance-left,
.hall-decor-entrance-right {
	font-size: 8px;
	letter-spacing: 1px;
	white-space: nowrap;
	font-weight: 600;
}

.hall-decor-ada {
	font-size: 15px;
	line-height: 1;
	color: #2f6fd0;
}

.hall-decor-stairs {
	width: 40px;
	height: 14px;
	background: repeating-linear-gradient(to bottom, #cfcfcf 0 2px, transparent 2px 4px);
}

.hall-decor-label {
	font-size: 9px;
	letter-spacing: 2px;
	text-align: center;
	white-space: nowrap;
}

/* A label given a width becomes a ruled divider with the text centred. */
.hall-decor-label span { padding: 0 6px; }
.hall-decor-label[style*="width"] {
	display: flex;
	align-items: center;
}
.hall-decor-label[style*="width"]::before,
.hall-decor-label[style*="width"]::after {
	content: "";
	flex: 1;
	border-top: 1px solid #d2d2d2;
}

/* Template rows hidden from customers (admin preview only). */
.seat.iv-seat-hidden {
	background-color: transparent;
	border-style: dashed;
	border-color: #b9b9b9;
	color: #b9b9b9;
}

/* ---------------------------------------------------------------------
   Pan/zoom viewport (js/seat-map.js). The wrapper is the fixed frame;
   the stage inside it is moved and scaled with a transform, so the
   frame needs a definite height to hold shape.
   --------------------------------------------------------------------- */

.seatmap-viewport {
	height: 520px;
	position: relative;
	overflow: hidden;
	background: #fdfdfd;
	/* Hands every gesture to the pointer handlers; without it the browser
	   claims drags for page scrolling and panning fights the page. */
	touch-action: none;
	cursor: grab;
	outline: none;
	border: 1px solid #d9d9d9;
	border-radius: 8px;
}

.seatmap-viewport:focus-visible {
	box-shadow: inset 0 0 0 2px #a6192e;
}

.seatmap-viewport.is-panning {
	cursor: grabbing;
}

/* will-change is set from the script only while a gesture is live; a
   permanently promoted layer is a cached bitmap and goes blurry when
   scaled up. */
.seatmap-viewport .seatmap-stage {
	max-width: none;
	transform-origin: 0 0;
}

/* Stop the browser turning a drag across the 10px seats into an image
   drag or a text selection. */
.seatmap-viewport .seat,
.seatmap-viewport .row-label,
.seatmap-viewport img {
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
}

.seatmap-controls {
	position: absolute;
	right: 10px;
	top: 10px;
	z-index: 100;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.seatmap-button {
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 18px;
	line-height: 1;
	color: #fff;
	background: rgba(0, 0, 0, 0.55);
	border: none;
	border-radius: 4px;
	cursor: pointer;
	touch-action: manipulation;
}

.seatmap-button:hover {
	background: rgba(0, 0, 0, 0.75);
}

.seatmap-button:disabled {
	opacity: 0.4;
	cursor: default;
}

/* The legend shown above a map. */
.seatmap-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	align-items: center;
	margin: 8px 0;
	font-size: 12px;
	color: #555;
}

.seatmap-legend .seat {
	cursor: default;
	margin: 0 4px 0 0;
}

@media screen and (max-width: 1200px) {
	.seatmap-viewport {
		height: 70vh;
		min-height: 320px;
	}

	/* Comfortably past the 24px minimum for a touch target. */
	.seatmap-button {
		width: 40px;
		height: 40px;
		font-size: 20px;
	}
}
