/*
 * d3td-frontend.css
 * TheatreDesk frontend — standalone, theme-independent.
 * All rules scoped to .d3td-wrap
 */

body:has( .d3td-wrap ) .site-main,
body:has( .d3td-wrap ) main,
body:has( .d3td-wrap ) #content,
body:has( .d3td-wrap ) .page-content {
    min-height: 70vh;
}
body:not(.logged-in):has( .d3td-wrap ) .site-main,
body:not(.logged-in):has( .d3td-wrap ) main,
body:not(.logged-in):has( .d3td-wrap ) #content,
body:not(.logged-in):has( .d3td-wrap ) .page-content {
	min-height: 100vh;
}

/* ── Elementor reset override ─────────────────────────────────────────────── */

.d3td-wrap, .d3td-wrap * {
    box-sizing: border-box !important;
}

.d3td-wrap input,
.d3td-wrap select,
.d3td-wrap textarea {
    font-family: inherit !important;
    font-size: 15px !important;
    line-height: normal !important;
    color: #222 !important;
    background: #fff !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.d3td-wrap button,
.d3td-wrap .d3td-btn {
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: normal !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

.d3td-wrap table {
    border-collapse: collapse !important;
    width: 100% !important;
}

.d3td-wrap td,
.d3td-wrap th {
    padding: 10px 12px !important;
    border: none !important;
}

.d3td-wrap a {
    text-decoration: none !important;
}

.d3td-wrap ul, .d3td-wrap ol {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.d3td-wrap li {
    margin: 0 !important;
    padding: 3px 0 !important;
}


/* ── Layout ───────────────────────────────────────────────────────────────── */

.d3td-wrap {
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px 16px;
}

/* ── Notices ──────────────────────────────────────────────────────────────── */

.d3td-notice {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 16px;
	font-size: 14px;
}

.d3td-notice-error {
	background: #fdecea;
	border-left: 4px solid #e53935;
	color: #b71c1c;
}

.d3td-notice-warning {
	background: #fff8e1;
	border-left: 4px solid #f9a825;
	color: #795548;
}

.d3td-notice-success {
	background: #e8f5e9;
	border-left: 4px solid #2e7d32;
	color: #1b5e20;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.d3td-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 20px;
	border-radius: 5px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	border: 2px solid transparent;
	text-decoration: none;
	transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
	white-space: nowrap;
}

.d3td-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.d3td-btn-primary {
	background: #1a6b3c;
	color: #fff;
	border-color: #1a6b3c;
}

.d3td-btn-primary:hover:not(:disabled) {
	background: #145530;
	border-color: #145530;
	color: #fff;
	text-decoration: none;
}

.d3td-btn-secondary {
	background: #fff;
	color: #1a6b3c;
	border-color: #1a6b3c;
}

.d3td-btn-secondary:hover:not(:disabled) {
	background: #f0faf4;
	color: #1a6b3c;
	text-decoration: none;
}

.d3td-btn-ghost {
	background: transparent;
	color: #555;
	border-color: #ccc;
}

.d3td-btn-ghost:hover:not(:disabled) {
	background: #f5f5f5;
	color: #333;
	text-decoration: none;
}

.d3td-btn-danger {
	background: #e53935;
	color: #fff;
	border-color: #e53935;
}

.d3td-btn-danger:hover:not(:disabled) {
	background: #b71c1c;
	border-color: #b71c1c;
}

.d3td-btn-lg {
	padding: 12px 28px;
	font-size: 16px;
}

.d3td-btn-sm {
	padding: 5px 12px;
	font-size: 12px;
}

/* ── Section title ────────────────────────────────────────────────────────── */

.d3td-section-title {
	font-size: 20px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 20px;
	padding-bottom: 10px;
	border-bottom: 3px solid #1a6b3c;
}

/* ── Form elements ────────────────────────────────────────────────────────── */

.d3td-form-group {
	margin-bottom: 20px;
}

.d3td-label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	color: #333;
	margin-bottom: 6px;
}

.d3td-optional {
	font-weight: 400;
	color: #888;
	font-size: 12px;
}

.d3td-input {
	display: block;
	width: 100%;
	max-width: 480px;
	padding: 10px 14px;
	font-size: 15px;
	border: 2px solid #ddd;
	border-radius: 5px;
	color: #222;
	background: #fff;
	transition: border-color 0.15s;
	font-family: inherit;
}

.d3td-input:focus {
	outline: none;
	border-color: #1a6b3c;
}

textarea.d3td-input {
	resize: vertical;
	min-height: 80px;
}

.d3td-select {
	padding: 8px 12px;
	font-size: 14px;
	border: 2px solid #ddd;
	border-radius: 5px;
	background: #fff;
	color: #222;
	font-family: inherit;
}

.d3td-form-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 24px;
}

.d3td-form-actions-center {
	justify-content: center;
}

/* ── Plays list ───────────────────────────────────────────────────────────── */

.d3td-plays-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
	gap: 24px;
}

.d3td-play-card {
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow 0.2s, transform 0.2s;
	display: flex;
	flex-direction: column;
}

.d3td-play-card:hover {
	box-shadow: 0 4px 16px rgba(0,0,0,0.1);
	transform: translateY( -2px );
}

.d3td-play-card-img-wrap {
	display: block;
	aspect-ratio: 16/9;
	overflow: hidden;
}

.d3td-play-card-img-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s;
}

.d3td-play-card:hover .d3td-play-card-img-wrap img {
	transform: scale(1.03);
}

.d3td-play-card-body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.d3td-play-card-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0;
	line-height: 1.3;
}

.d3td-play-card-title a {
	color: #1a1a1a;
	text-decoration: none;
}

.d3td-play-card-title a:hover {
	color: #1a6b3c;
}

.d3td-play-card-meta {
	font-size: 13px;
	color: #555;
	display: flex;
	align-items: center;
	gap: 6px;
}

.d3td-play-card-desc {
	font-size: 13px;
	color: #666;
	margin: 4px 0 8px;
	line-height: 1.5;
}

.d3td-play-card-body .d3td-btn {
	margin-top: auto;
	align-self: flex-start;
}

.d3td-muted {
	color: #999;
	font-size: 12px;
}

/* ── Single play ──────────────────────────────────────────────────────────── */

.d3td-play-header {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 32px;
	margin-bottom: 40px;
}

@media ( max-width: 700px ) {
	.d3td-play-header {
		grid-template-columns: 1fr;
	}
}

.d3td-play-cover img {
	width: 100%;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.d3td-play-title {
	font-size: 28px;
	font-weight: 800;
	margin: 0 0 16px;
	color: #1a1a1a;
	line-height: 1.2;
}

.d3td-play-detail {
	font-size: 14px;
	color: #444;
	margin-bottom: 8px;
}

.d3td-play-description {
	font-size: 15px;
	color: #555;
	margin-top: 16px;
	line-height: 1.7;
}

/* ── Booking section ──────────────────────────────────────────────────────── */

.d3td-booking-section {
	background: #f9f9f9;
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 28px;
}

/* ── Date buttons ─────────────────────────────────────────────────────────── */

.d3td-date-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 24px;
}

.d3td-date-btn {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 12px 18px;
	background: #fff;
	border: 2px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: #333;
	transition: border-color 0.15s, background 0.15s;
	text-align: left;
}

.d3td-date-btn:hover {
	border-color: #1a6b3c;
	background: #f0faf4;
	color: #333;
}

.d3td-date-btn.active {
	border-color: #1a6b3c;
	background: #1a6b3c;
	color: #fff;
}

.d3td-date-time {
	font-size: 12px;
	font-weight: 400;
	opacity: 0.8;
}

.d3td-date-venue {
	font-size: 11px;
	font-weight: 400;
	opacity: 0.7;
	margin-top: 2px;
}

/* ── Seating chart ────────────────────────────────────────────────────────── */

.d3td-stage-label {
	text-align: center;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.15em;
	color: #888;
	background: #eee;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 6px;
	margin-bottom: 20px;
}

#d3td-seating-section {
	max-width: 500px;
	margin: 0 auto;
}

.d3td-seating-chart-outer {
    display: flex;
    justify-content: center;
}

.d3td-seating-chart-wrap {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}

.d3td-seating-chart-wrap {
	display: flex;
	flex-direction: column;
	gap: 4px;
	overflow-x: auto;
	padding-bottom: 8px;
}

.d3td-row {
	display: flex;
	align-items: center;
	gap: 6px;
}

.d3td-row-label {
	font-size: 11px;
	font-weight: 700;
	color: #666;
	width: 11px;
	text-align: right;
	flex-shrink: 0;
}

.d3td-side {
	display: flex;
	gap: 3px;
}

.d3td-aisle {
	width: 20px;
	flex-shrink: 0;
}

.d3td-seat {
	width: 26px;
	height: 26px;
	border-radius: 4px 4px 2px 2px;
	border: 1px solid transparent;
	cursor: default;
	transition: transform 0.1s, background 0.1s;
	flex-shrink: 0;
	position: relative;
}

.d3td-seat::after {
	content: '';
	display: block;
	height: 4px;
	background: rgba(0,0,0,0.12);
	border-radius: 0 0 2px 2px;
	position: absolute;
	bottom: -5px;
	left: 2px;
	right: 2px;
}

.d3td-seat-available {
	background: #1a6b3c;
	border-color: #155530;
	cursor: pointer;
}

.d3td-seat-available:hover {
	background: #22883e;
	transform: translateY(-2px);
}

.d3td-seat-selected {
	background: #e67e22;
	border-color: #ca6f1e;
	cursor: pointer;
	transform: translateY(-2px);
	box-shadow: 0 0 0 2px #f0a84a;
}

.d3td-seat-held {
	background: #f0e68c;
	border-color: #d4b900;
	cursor: not-allowed;
}

.d3td-seat-booked {
	background: #c8c8c8;
	border-color: #aaa;
	cursor: not-allowed;
}

.d3td-seat-tooltip {
    display: none;
    position: absolute;
    z-index: 99999;
    background: #1a1a1a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: opacity 0.08s;
}

.d3td-seat-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1a1a;
}

.d3td-scroll-hint {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a6b3c;
    color: #fff;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: bottom 0.3s ease;
    z-index: 9999;
}

.d3td-scroll-hint.visible {
    bottom: 24px;
}

/* ── Legend ───────────────────────────────────────────────────────────────── */

.d3td-seating-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid #eee;
	font-size: 12px;
	justify-contet: center;
}

.d3td-legend-item {
	display: flex;
	align-items: center;
	gap: 6px;
}

.d3td-legend-item::before {
	content: '';
	display: inline-block;
	width: 18px;
	height: 18px;
	border-radius: 3px;
	flex-shrink: 0;
}

.d3td-legend-available::before { background: #1a6b3c; }
.d3td-legend-selected::before  { background: #e67e22; }
.d3td-legend-held::before      { background: #f0e68c; border: 1px solid #d4b900; }
.d3td-legend-booked::before    { background: #c8c8c8; }

/* ── Basket ───────────────────────────────────────────────────────────────── */

.d3td-basket-inner {
	margin-top: 28px;
	padding: 20px;
	background: #fff;
	border: 2px solid #1a6b3c;
	border-radius: 8px;
}

.d3td-basket-inner h3 {
	margin: 0 0 12px;
	font-size: 16px;
	color: #1a6b3c;
}

#d3td-basket-list {
	margin: 0 0 12px;
	padding-left: 20px;
	font-size: 14px;
	max-height: 180px;
	overflow-y: auto;
}

#d3td-basket-list li {
	padding: 3px 0;
}

.d3td-basket-total {
	font-size: 14px;
	color: #444;
	margin-bottom: 16px;
}

/* ── Hold timer ───────────────────────────────────────────────────────────── */

.d3td-hold-timer {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #e8f5e9;
	border: 1px solid #a5d6a7;
	border-radius: 6px;
	padding: 12px 18px;
	margin-bottom: 20px;
	font-size: 15px;
	color: #1a6b3c;
}

.d3td-timer-icon {
	font-size: 20px;
}

#d3td-timer-display {
	font-size: 22px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* ── Checkout summary ─────────────────────────────────────────────────────── */

.d3td-summary-card {
	background: #f5f5f5;
	border-left: 4px solid #1a6b3c;
	border-radius: 0 6px 6px 0;
	padding: 16px 20px;
	margin-bottom: 28px;
}

.d3td-summary-card h3 {
	margin: 0 0 10px;
	font-size: 17px;
	color: #1a1a1a;
}

.d3td-summary-row {
	display: flex;
	gap: 10px;
	font-size: 14px;
	color: #444;
	margin-bottom: 6px;
	align-items: flex-start;
}

.d3td-summary-seats {
	margin: 0;
	padding-left: 18px;
	font-size: 13px;
}

/* ── Checkout loading ─────────────────────────────────────────────────────── */

.d3td-loading {
	text-align: center;
	padding: 48px;
	color: #888;
	font-style: italic;
}

/* ── Success screen ───────────────────────────────────────────────────────── */

.d3td-success-card {
	text-align: center;
	padding: 48px 24px;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 8px;
}

.d3td-success-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	background: #1a6b3c;
	color: #fff;
	border-radius: 50%;
	font-size: 36px;
	margin: 0 auto 20px;
}

.d3td-success-card h2 {
	font-size: 24px;
	color: #1a6b3c;
	margin-bottom: 10px;
}

/* ── Bookings table ───────────────────────────────────────────────────────── */

.d3td-filters {
	margin-bottom: 16px;
}

.d3td-filters-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	padding: 14px 16px;
	background: #f5f5f5;
	border-radius: 6px;
}

.d3td-search {
	min-width: 200px;
}

.d3td-result-count {
	font-size: 13px;
	color: #666;
	margin: 8px 0 12px;
}

.d3td-table-scroll {
	overflow-x: auto;
}

.d3td-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	background: #fff;
}

.d3td-table th {
	background: #2c3e50;
	color: #fff;
	font-weight: 600;
	padding: 10px 12px;
	text-align: left;
	white-space: nowrap;
}

.d3td-table td {
	padding: 10px 12px;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}

.d3td-table tbody tr:hover td {
	background: #fafafa;
}

.d3td-table .d3td-cancelled td {
	opacity: 0.55;
}

.d3td-table .d3td-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    
}

.d3td-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
}

.d3td-badge-confirmed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1a6b3c;
    color: #fff;
    font-size: 14px;
    padding: 0;
}

.d3td-badge-cancelled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e53935;
    color: #fff;
    font-size: 14px;
    padding: 0;
}

.d3td-empty {
	padding: 32px;
	text-align: center;
	color: #888;
	font-style: italic;
	background: #fafafa;
	border-radius: 6px;
}

/* ── Info table (modals) ──────────────────────────────────────────────────── */

.d3td-info-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.d3td-info-table th {
	text-align: left;
	font-weight: 600;
	color: #555;
	padding: 7px 16px 7px 0;
	white-space: nowrap;
	vertical-align: top;
	width: 38%;
	background-color:transparent !important;
	border:none !important;
}

.d3td-info-table td {
	padding: 7px 0;
	color: #222;
	background-color:transparent !important;
	border:none !important;
}

/* ── Modals ───────────────────────────────────────────────────────────────── */

.d3td-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.55);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	max-width:unset;
}

.d3td-modal {
	background: #fff;
	border-radius: 8px;
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 12px 48px rgba(0,0,0,0.2);
}

.d3td-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 3px solid #1a6b3c;
}

.d3td-modal-header h3 {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: #1a1a1a;
}

.d3td-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #888;
	line-height: 1;
	padding: 0;
}

.d3td-modal-close:hover {
	color: #333;
}

.d3td-modal-body {
	padding: 20px;
}

/* ── Login page ───────────────────────────────────────────────────────────── */
 
.d3td-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
}
 
.d3td-login-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
 
.d3td-login-logo {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: #1a6b3c;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}
 
.d3td-login-remember {
    margin-bottom: 20px;
}
 
.d3td-label-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
}
 
.d3td-btn-block {
    width: 100%;
    justify-content: center;
}

.d3td-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: color 0.15s;
}

.d3td-logout-btn:hover {
    color: #e53935;
}

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

@media ( max-width: 600px ) {
	.d3td-plays-grid {
		grid-template-columns: 1fr;
	}

	.d3td-booking-section {
		padding: 16px;
	}

	.d3td-filters-inner {
		flex-direction: column;
		align-items: stretch;
	}

	.d3td-select,
	.d3td-search {
		width: 100%;
	}
}

@media ( max-width: 480px ) {
    .d3td-seat {
        width: 17px;
        height: 20px;
    }

    .d3td-seat::after {
        height: 3px;
        bottom: -4px;
    }

    .d3td-side {
        gap: 2px;
    }

    .d3td-aisle {
        width: 12px;
    }

    .d3td-row {
        gap: 4px;
    }

    .d3td-row-label {
        font-size: 10px;
        width: 16px;
    }
}

@media ( max-width: 360px ) {
    .d3td-seat {
        width: 16px;
        height: 16px;
    }

    .d3td-aisle {
        width: 8px;
    }

    .d3td-side {
        gap: 1px;
    }
}