/**
 * File: src/assets/css/clisyc-checkin-page.css
 * Styles for the dedicated admin Check-In page.
 * Designed for on-site tablet use with large touch targets.
 *
 * @package    ClientSyncPro
 * @subpackage ClientSyncPro/Assets/CSS
 */

/* ── Page Layout ─────────────────────────────────────────────────── */
.clisyc-checkin-wrap {
	max-width: 960px;
	margin: 20px auto;
	padding: 0 16px;
}

.clisyc-checkin-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
}

.clisyc-checkin-header h1 {
	display: flex;
	align-items: center;
	margin-bottom: 0;
}

/* Live Clock */
.clisyc-live-clock {
	font-size: 28px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: #1f2937;
	letter-spacing: 0.02em;
}

/* Event Info Banner */
.clisyc-event-info {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
	border: 1px solid #bfdbfe;
	border-radius: 10px;
	padding: 14px 20px;
	margin-bottom: 20px;
}

.clisyc-event-info__details {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.clisyc-event-info__name {
	font-size: 17px;
	font-weight: 700;
	color: #1e40af;
}

.clisyc-event-info__venue,
.clisyc-event-info__time {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 14px;
	color: #4b5563;
}

.clisyc-event-info__venue .dashicons,
.clisyc-event-info__time .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #6b7280;
}

.clisyc-event-info__countdown {
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

.clisyc-countdown--future {
	color: #059669;
}

.clisyc-countdown--now {
	color: #dc2626;
	font-size: 16px;
	animation: clisyc-pulse 1.5s ease-in-out infinite;
}

.clisyc-countdown--past {
	color: #6b7280;
}

@keyframes clisyc-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

/* Event Filter Dropdown */
.clisyc-checkin-event-filter {
	min-width: 180px;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	background: #ffffff;
	cursor: pointer;
}

/* Event name in cards */
.clisyc-checkin-card__event {
	font-size: 13px;
	color: #1e40af;
	font-weight: 500;
	margin-top: 2px;
}

/* Event name in door list */
.clisyc-door-list__event {
	font-size: 12px;
	color: #1e40af;
	font-weight: 500;
}

/* ── 1. Stats Bar ───────────────────────────────────────────────── */
.clisyc-checkin-stats {
	margin-bottom: 24px;
}

.clisyc-stats-cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-bottom: 8px;
}

.clisyc-stats-card {
	text-align: center;
	padding: 16px 12px;
	border-radius: 10px;
	border: 2px solid #e5e7eb;
	background: #ffffff;
}

.clisyc-stats-card__value {
	display: block;
	font-size: 32px;
	font-weight: 800;
	line-height: 1.1;
}

.clisyc-stats-card__label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b7280;
	margin-top: 4px;
}

/* Card colour accents */
.clisyc-stats-card--checked-in {
	border-color: #a7f3d0;
	background: #f0fdf4;
}
.clisyc-stats-card--checked-in .clisyc-stats-card__value {
	color: #059669;
}

.clisyc-stats-card--expected {
	border-color: #bfdbfe;
	background: #eff6ff;
}
.clisyc-stats-card--expected .clisyc-stats-card__value {
	color: #2563eb;
}

.clisyc-stats-card--remaining {
	border-color: #fde68a;
	background: #fffbeb;
}
.clisyc-stats-card--remaining .clisyc-stats-card__value {
	color: #d97706;
}

.clisyc-stats-card--rate {
	border-color: #c4b5fd;
	background: #f5f3ff;
}
.clisyc-stats-card--rate .clisyc-stats-card__value {
	color: #7c3aed;
}

/* Progress bar */
.clisyc-stats-progress {
	height: 6px;
	background: #e5e7eb;
	border-radius: 99px;
	overflow: hidden;
}

.clisyc-stats-progress__bar {
	height: 100%;
	background: linear-gradient(90deg, #059669, #34d399);
	border-radius: 99px;
	transition: width 0.5s ease;
}

/* ── 2. Scanner Section ──────────────────────────────────────────── */
.clisyc-checkin-scanner-section {
	margin-bottom: 24px;
	text-align: center;
}

.clisyc-checkin-scanner-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 14px 32px;
	background: #7c3aed;
	color: #ffffff;
	border: none;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
	min-height: 52px;
}

.clisyc-checkin-scanner-btn:hover {
	background: #6d28d9;
}

.clisyc-checkin-scanner-btn .dashicons {
	font-size: 22px;
	width: 22px;
	height: 22px;
}

.clisyc-scanner-container {
	margin-top: 16px;
	background: #1e1e2e;
	border-radius: 12px;
	overflow: hidden;
	max-width: 500px;
	margin-left: auto;
	margin-right: auto;
}

.clisyc-scanner-reader {
	width: 100%;
	min-height: 300px;
}

.clisyc-scanner-reader video {
	border-radius: 8px;
}

.clisyc-scanner-result {
	padding: 16px 20px;
	text-align: center;
}

.clisyc-scanner-result--success {
	background: #d1fae5;
	color: #065f46;
	border-top: 3px solid #059669;
}

.clisyc-scanner-result--error {
	background: #fee2e2;
	color: #991b1b;
	border-top: 3px solid #dc2626;
}

.clisyc-scanner-result--already {
	background: #fef3c7;
	color: #92400e;
	border-top: 3px solid #d97706;
}

.clisyc-scanner-result__name {
	font-size: 20px;
	font-weight: 700;
	margin-bottom: 4px;
}

.clisyc-scanner-result__seats {
	font-size: 14px;
	opacity: 0.8;
}

.clisyc-scanner-result__message {
	font-size: 16px;
	font-weight: 600;
}

/* ── 3. Search & Filters ─────────────────────────────────────────── */
.clisyc-checkin-filters {
	margin-bottom: 20px;
}

.clisyc-checkin-search-row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.clisyc-checkin-search-input {
	flex: 1;
	min-width: 200px;
	padding: 10px 16px;
	font-size: 16px;
	border: 2px solid #d1d5db;
	border-radius: 8px;
	min-height: 48px;
	box-sizing: border-box;
}

.clisyc-checkin-search-input:focus {
	border-color: #3b82f6;
	outline: none;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.clisyc-checkin-date-input {
	padding: 10px 16px;
	font-size: 16px;
	border: 2px solid #d1d5db;
	border-radius: 8px;
	min-height: 48px;
	box-sizing: border-box;
}

.clisyc-checkin-date-input:focus {
	border-color: #3b82f6;
	outline: none;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.clisyc-checkin-search-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 24px;
	font-size: 16px;
	font-weight: 600;
	min-height: 48px;
	border-radius: 8px;
	cursor: pointer;
}

.clisyc-checkin-search-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* ── 4. Toolbar (View Toggle & Bulk Actions) ─────────────────────── */
.clisyc-checkin-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.clisyc-checkin-toolbar__views {
	display: flex;
	gap: 4px;
	background: #f3f4f6;
	border-radius: 8px;
	padding: 3px;
}

.clisyc-view-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 36px;
	border: none;
	background: transparent;
	border-radius: 6px;
	cursor: pointer;
	color: #6b7280;
	transition: all 0.15s ease;
}

.clisyc-view-toggle:hover {
	color: #374151;
	background: #e5e7eb;
}

.clisyc-view-toggle--active {
	background: #ffffff;
	color: #111827;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.clisyc-view-toggle .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.clisyc-checkin-toolbar__bulk {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.clisyc-bulk-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 6px;
	cursor: pointer;
	min-height: 36px;
}

.clisyc-bulk-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.clisyc-bulk-btn--checkin {
	background: #059669;
	border-color: #059669;
	color: #ffffff;
}
.clisyc-bulk-btn--checkin:hover {
	background: #047857;
	border-color: #047857;
	color: #ffffff;
}
.clisyc-bulk-btn--checkin:disabled {
	background: #d1d5db;
	border-color: #d1d5db;
	color: #6b7280;
	cursor: default;
}

/* ── 5. Results ──────────────────────────────────────────────────── */
.clisyc-checkin-results {
	min-height: 200px;
}

.clisyc-checkin-placeholder {
	text-align: center;
	padding: 60px 20px;
	color: #6b7280;
	font-size: 16px;
}

.clisyc-checkin-card {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
	background: #ffffff;
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	margin-bottom: 10px;
	transition: border-color 0.15s ease;
}

.clisyc-checkin-card:hover {
	border-color: #d1d5db;
}

.clisyc-checkin-card--checked-in {
	border-color: #a7f3d0;
	background: #f0fdf4;
}

.clisyc-checkin-card__info {
	flex: 1;
	min-width: 0;
}

.clisyc-checkin-card__name {
	font-size: 18px;
	font-weight: 700;
	color: #111827;
	margin-bottom: 4px;
}

.clisyc-checkin-card__meta {
	font-size: 14px;
	color: #6b7280;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.clisyc-checkin-card__meta-item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.clisyc-checkin-card__meta-item .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #9ca3af;
}

.clisyc-checkin-card__seats {
	margin-top: 6px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.clisyc-checkin-card__seat-tag {
	display: inline-block;
	padding: 2px 8px;
	background: #dbeafe;
	border: 1px solid #93c5fd;
	border-radius: 10px;
	font-size: 12px;
	font-weight: 500;
	color: #1e40af;
}

.clisyc-checkin-card__status {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 9999px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	white-space: nowrap;
}

.clisyc-checkin-card__status--checked-in {
	background: #d1fae5;
	color: #065f46;
}

.clisyc-checkin-card__status--confirmed {
	background: #dbeafe;
	color: #1e40af;
}

.clisyc-checkin-card__status--pending {
	background: #fef3c7;
	color: #92400e;
}

.clisyc-checkin-card__action {
	flex-shrink: 0;
}

.clisyc-checkin-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 12px 24px;
	background: #059669;
	color: #ffffff;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	min-height: 48px;
	transition: background 0.15s ease;
	white-space: nowrap;
}

.clisyc-checkin-btn:hover {
	background: #047857;
}

.clisyc-checkin-btn:disabled {
	background: #d1d5db;
	color: #6b7280;
	cursor: default;
}

.clisyc-checkin-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Small check-in button for door list */
.clisyc-checkin-btn--sm {
	padding: 6px 16px;
	font-size: 13px;
	min-height: 34px;
	border-radius: 6px;
}

/* Checked-in time display */
.clisyc-checkin-card__checked-time {
	font-size: 13px;
	color: #059669;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 4px;
}

/* Undo check-in button (subtle text link style) */
.clisyc-undo-checkin-btn {
	display: inline-block;
	margin-top: 6px;
	padding: 4px 10px;
	background: none;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 12px;
	color: #6b7280;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
}

.clisyc-undo-checkin-btn:hover {
	color: #dc2626;
	border-color: #dc2626;
}

.clisyc-undo-checkin-btn:disabled {
	opacity: 0.5;
	cursor: default;
}

.clisyc-undo-checkin-btn--sm {
	margin-top: 4px;
	padding: 2px 8px;
	font-size: 11px;
}

/* ── 6. Door List Table ──────────────────────────────────────────── */
.clisyc-door-list {
	width: 100%;
	border-collapse: collapse;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
}

.clisyc-door-list thead {
	background: #f9fafb;
}

.clisyc-door-list th {
	padding: 12px 16px;
	text-align: left;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b7280;
	border-bottom: 2px solid #e5e7eb;
}

.clisyc-door-list td {
	padding: 12px 16px;
	border-bottom: 1px solid #f3f4f6;
	font-size: 14px;
	vertical-align: middle;
}

.clisyc-door-list__th-check,
.clisyc-door-list__td-check {
	width: 40px;
	text-align: center;
}

.clisyc-door-list__td-check input[type="checkbox"],
.clisyc-door-list__th-check input[type="checkbox"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
}

.clisyc-door-list__td-name strong {
	font-size: 15px;
	color: #111827;
}

.clisyc-door-list__email {
	font-size: 12px;
	color: #9ca3af;
}

.clisyc-door-list__row--checked-in {
	background: #f0fdf4;
}

.clisyc-door-list__row--checked-in td {
	border-bottom-color: #d1fae5;
}

.clisyc-door-list tbody tr:hover {
	background: #f9fafb;
}

.clisyc-door-list__row--checked-in:hover {
	background: #ecfdf5;
}

.clisyc-door-list tbody tr:last-child td {
	border-bottom: none;
}

/* ── 7. Check-In Flash Feedback ──────────────────────────────────── */
@keyframes clisyc-flash-success {
	0%   { box-shadow: inset 0 0 0 0 rgba(5, 150, 105, 0); }
	30%  { box-shadow: inset 0 0 0 200px rgba(5, 150, 105, 0.12); }
	100% { box-shadow: inset 0 0 0 0 rgba(5, 150, 105, 0); }
}

@keyframes clisyc-flash-error {
	0%   { box-shadow: inset 0 0 0 0 rgba(220, 38, 38, 0); }
	30%  { box-shadow: inset 0 0 0 200px rgba(220, 38, 38, 0.1); }
	100% { box-shadow: inset 0 0 0 0 rgba(220, 38, 38, 0); }
}

.clisyc-checkin-flash--success {
	animation: clisyc-flash-success 0.6s ease-out;
}

.clisyc-checkin-flash--error {
	animation: clisyc-flash-error 0.6s ease-out;
}

/* ── 8. Loading Spinner ──────────────────────────────────────────── */
.clisyc-checkin-loading {
	text-align: center;
	padding: 40px 20px;
	color: #6b7280;
}

.clisyc-checkin-loading::after {
	content: '';
	display: inline-block;
	width: 24px;
	height: 24px;
	border: 3px solid #e5e7eb;
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: clisyc-spin 0.6s linear infinite;
	vertical-align: middle;
	margin-left: 8px;
}

@keyframes clisyc-spin {
	to { transform: rotate(360deg); }
}

/* ── 9. Responsive / Tablet ──────────────────────────────────────── */
@media (max-width: 768px) {
	.clisyc-checkin-wrap {
		padding: 0 8px;
	}

	.clisyc-stats-cards {
		grid-template-columns: repeat(2, 1fr);
	}

	.clisyc-stats-card__value {
		font-size: 24px;
	}

	.clisyc-checkin-search-row {
		flex-direction: column;
	}

	.clisyc-checkin-search-input,
	.clisyc-checkin-date-input,
	.clisyc-checkin-search-btn {
		width: 100%;
	}

	.clisyc-checkin-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.clisyc-checkin-toolbar__views {
		align-self: flex-start;
	}

	.clisyc-checkin-toolbar__bulk {
		flex-direction: column;
	}

	.clisyc-checkin-card {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.clisyc-checkin-card__action {
		display: flex;
	}

	.clisyc-checkin-btn {
		width: 100%;
		justify-content: center;
	}

	.clisyc-scanner-container {
		max-width: 100%;
	}

	/* Door list: horizontal scroll on small screens */
	.clisyc-door-list {
		display: block;
		overflow-x: auto;
	}
}

/* ── 10. Print Stylesheet ────────────────────────────────────────── */
@media print {
	/* Hide everything except the door list */
	#adminmenuwrap,
	#adminmenuback,
	#wpadminbar,
	#wpfooter,
	.clisyc-checkin-scanner-section,
	.clisyc-checkin-filters,
	.clisyc-checkin-toolbar,
	.clisyc-checkin-stats,
	.clisyc-checkin-btn,
	.clisyc-checkin-btn--sm,
	.clisyc-bulk-checkbox,
	.clisyc-door-list__th-check,
	.clisyc-door-list__td-check,
	.notice,
	.update-nag {
		display: none !important;
	}

	#wpcontent {
		margin-left: 0 !important;
	}

	.clisyc-checkin-wrap {
		max-width: 100%;
		margin: 0;
		padding: 0;
	}

	.clisyc-checkin-wrap h1 {
		font-size: 18px;
		margin-bottom: 8px;
	}

	/* Card view: hide in print; only print table */
	.clisyc-checkin-card {
		display: none !important;
	}

	.clisyc-door-list {
		border: 1px solid #ccc;
		font-size: 12px;
	}

	.clisyc-door-list th,
	.clisyc-door-list td {
		padding: 6px 10px;
		border: 1px solid #ddd;
	}

	.clisyc-door-list__row--checked-in {
		background: #f0f0f0 !important;
	}

	.clisyc-checkin-card__status {
		border: 1px solid #ccc;
		background: transparent !important;
		color: #333 !important;
		font-size: 11px;
	}

	.clisyc-checkin-card__checked-time {
		color: #333;
	}
}
