/**
 * Advisor Dashboard Styles
 *
 * Public-facing styles for the advisor dashboard.
 */

/* ============================================
   Base Styles
   ============================================ */

.workshops-advisor-dashboard {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #1e1e1e;
	max-width: 1400px;
	margin: 0 auto;
	padding: 20px;
}

.workshops-advisor-dashboard * {
	box-sizing: border-box;
}

/* ============================================
   Login Form
   ============================================ */

.advisor-login-container {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 400px;
	padding: 40px 20px;
}

.advisor-login-box {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 40px;
	max-width: 400px;
	width: 100%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.advisor-login-box h2 {
	margin: 0 0 10px;
	font-size: 24px;
	font-weight: 600;
	color: #1e1e1e;
}

.advisor-login-description {
	margin: 0 0 24px;
	color: #666;
	font-size: 14px;
}

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

.advisor-login-form label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	color: #1e1e1e;
}

.advisor-login-form input[type="email"],
.advisor-login-form input[type="password"] {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	font-size: 16px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.advisor-login-form input[type="email"]:focus,
.advisor-login-form input[type="password"]:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.form-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #dc2626;
	padding: 12px;
	border-radius: 6px;
	margin-bottom: 16px;
	font-size: 14px;
}

.advisor-login-button {
	width: 100%;
	padding: 14px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
}

.advisor-login-button:hover {
	background: #005a87;
}

.advisor-login-button:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.advisor-login-button .button-loading {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.advisor-login-help {
	margin: 20px 0 0;
	text-align: center;
	color: #666;
	font-size: 13px;
}

/* ============================================
   Dashboard Header
   ============================================ */

.advisor-dashboard-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid #e0e0e0;
}

.advisor-dashboard-header h1 {
	margin: 0;
	font-size: 28px;
	font-weight: 600;
}

.advisor-welcome {
	margin: 8px 0 0;
	color: #666;
	font-size: 16px;
}

.advisor-code {
	color: #999;
	font-family: monospace;
	font-size: 14px;
}

.advisor-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.advisor-admin-switcher__label {
	font-size: 13px;
	color: #666;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.advisor-admin-switcher {
	padding: 8px 12px;
	background: #fffbe6;
	color: #1e1e1e;
	border: 1px solid #e0c97a;
	border-radius: 6px;
	font-size: 14px;
	cursor: pointer;
	max-width: 280px;
}

.advisor-admin-switcher:focus {
	outline: 2px solid #2563eb;
	outline-offset: 1px;
}

.advisor-logout-button {
	padding: 10px 20px;
	background: #fff;
	color: #1e1e1e;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.2s;
}

.advisor-logout-button:hover {
	background: #f5f5f5;
	border-color: #bbb;
}

/* ============================================
   Tabs
   ============================================ */

.advisor-dashboard-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 24px;
	border-bottom: 2px solid #e0e0e0;
	padding-bottom: 0;
}

.tab-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	background: transparent;
	color: #666;
	border: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
}

.tab-button:hover {
	color: #1e1e1e;
}

.tab-button.active {
	color: #0073aa;
	border-bottom-color: #0073aa;
}

.tab-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 8px;
	background: #e8e8e8;
	color: #666;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
}

.tab-button.active .tab-count {
	background: #0073aa;
	color: #fff;
}

/* ============================================
   Tab Panels
   ============================================ */

.tab-panel {
	display: none;
}

.tab-panel.active {
	display: block;
}

.panel-header {
	margin-bottom: 20px;
}

.panel-header h2 {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 600;
}

.panel-description {
	margin: 0;
	color: #666;
	font-size: 14px;
}

/* ============================================
   Filters
   ============================================ */

.filter-controls {
	display: flex;
	gap: 16px;
	align-items: flex-end;
	margin-bottom: 16px;
	padding: 16px;
	background: #f8f9fa;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
}

.filter-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.filter-group label {
	font-size: 12px;
	font-weight: 500;
	color: #666;
}

.filter-select {
	min-width: 180px;
	padding: 8px 12px;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	font-size: 14px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-select:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.filter-clear-btn {
	padding: 8px 16px;
	background: #fff;
	color: #666;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s;
}

.filter-clear-btn:hover {
	background: #f5f5f5;
	border-color: #bbb;
	color: #333;
}

/* ============================================
   Tables
   ============================================ */

.table-container {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
}

.loading-indicator {
	padding: 40px;
	text-align: center;
	color: #666;
}

.no-data {
	padding: 40px;
	text-align: center;
	color: #666;
	font-style: italic;
}

.advisor-data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.advisor-data-table thead {
	background: #f8f8f8;
}

.advisor-data-table th {
	padding: 12px 16px;
	text-align: left;
	font-weight: 600;
	color: #1e1e1e;
	border-bottom: 1px solid #e0e0e0;
	white-space: nowrap;
}

.advisor-data-table td {
	padding: 12px 16px;
	border-bottom: 1px solid #f0f0f0;
	vertical-align: middle;
}

.advisor-data-table tbody tr:hover {
	background: #fafafa;
}

.advisor-data-table tbody tr:last-child td {
	border-bottom: none;
}

/* Cell Styles */
.cell-name {
	font-weight: 500;
}

.cell-phone {
	font-family: monospace;
	font-size: 12px;
}

.cell-email {
	max-width: 200px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cell-status {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	text-transform: capitalize;
}

.cell-status.registered {
	background: #fef3cd;
	color: #856404;
}

.cell-status.confirmed {
	background: #d4edda;
	color: #155724;
}

.cell-status.attended-yes {
	background: #cce5ff;
	color: #004085;
}

.cell-workshop {
	white-space: nowrap;
}

.cell-workshop .venue {
	display: block;
	font-size: 11px;
	color: #666;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
	.workshops-advisor-dashboard {
		padding: 16px;
	}

	.advisor-dashboard-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
	}

	.advisor-dashboard-tabs {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.tab-button {
		padding: 10px 16px;
		font-size: 14px;
		white-space: nowrap;
	}

	.filter-controls {
		flex-wrap: wrap;
	}

	.filter-group {
		flex: 1 1 calc(50% - 8px);
		min-width: 140px;
	}

	.filter-select {
		min-width: 100%;
	}

	.filter-clear-btn {
		flex: 1 1 100%;
	}

	.table-container {
		overflow-x: auto;
	}

	.advisor-data-table {
		min-width: 800px;
	}
}

@media (max-width: 480px) {
	.advisor-login-box {
		padding: 24px;
	}

	.advisor-login-box h2 {
		font-size: 20px;
	}

	.advisor-dashboard-header h1 {
		font-size: 22px;
	}
}

/* ============================================
   Notes Button
   ============================================ */

.cell-notes {
	text-align: center;
	width: 50px;
}

.notes-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	background: #f5f5f5;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	color: #666;
	cursor: pointer;
	transition: all 0.2s;
}

.notes-btn:hover {
	background: #0073aa;
	border-color: #0073aa;
	color: #fff;
}

.notes-btn svg {
	width: 16px;
	height: 16px;
}

/* ============================================
   Notes Modal
   ============================================ */

.notes-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.notes-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
}

.notes-modal-content {
	position: relative;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	max-width: 600px;
	width: 100%;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
}

.notes-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #e0e0e0;
}

.notes-modal-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #1e1e1e;
}

.notes-modal-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 6px;
	font-size: 24px;
	color: #666;
	cursor: pointer;
	transition: all 0.2s;
}

.notes-modal-close:hover {
	background: #f5f5f5;
	color: #1e1e1e;
}

.notes-modal-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Notes List */
.notes-list {
	flex: 1;
	overflow-y: auto;
	padding: 16px 24px;
	min-height: 150px;
	max-height: 400px;
}

.notes-loading,
.notes-empty,
.notes-error {
	padding: 40px;
	text-align: center;
	color: #666;
}

.notes-error {
	color: #dc2626;
}

.note-item {
	position: relative;
	padding: 16px;
	margin-bottom: 12px;
	background: #f8f9fa;
	border-radius: 8px;
	border-left: 3px solid #e0e0e0;
}

.note-item.note-own {
	border-left-color: #0073aa;
	background: #f0f7fb;
}

.note-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	font-size: 12px;
}

.note-author {
	font-weight: 600;
	color: #1e1e1e;
}

.note-date {
	color: #888;
}

.note-content {
	font-size: 14px;
	line-height: 1.5;
	color: #333;
	white-space: pre-wrap;
	word-break: break-word;
}

.note-delete {
	position: absolute;
	top: 8px;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 4px;
	font-size: 18px;
	color: #999;
	cursor: pointer;
	opacity: 0;
	transition: all 0.2s;
}

.note-item:hover .note-delete {
	opacity: 1;
}

.note-delete:hover {
	background: #fee2e2;
	color: #dc2626;
}

/* Notes Form */
.notes-form {
	padding: 16px 24px 24px;
	border-top: 1px solid #e0e0e0;
	background: #fafafa;
}

.notes-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 12px;
	border: 1px solid #d0d0d0;
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	resize: vertical;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.notes-form textarea:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.add-note-btn {
	margin-top: 12px;
	padding: 10px 20px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s;
}

.add-note-btn:hover {
	background: #005a87;
}

.add-note-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

/* Mobile adjustments for modal */
@media (max-width: 480px) {
	.notes-modal {
		padding: 10px;
	}

	.notes-modal-content {
		max-height: 90vh;
	}

	.notes-modal-header {
		padding: 16px;
	}

	.notes-list {
		padding: 12px 16px;
	}

	.notes-form {
		padding: 12px 16px 16px;
	}
}

/* ============================================
   Food Summary Inline (in filter bar)
   ============================================ */

.food-summary-inline {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-left: auto;
	padding-left: 16px;
	border-left: 1px solid #e0e0e0;
}

.meal-summary-group {
	display: flex;
	align-items: center;
	gap: 8px;
}

.meal-summary-label {
	font-size: 12px;
	color: #666;
	white-space: nowrap;
}

.meal-summary-label strong {
	color: #333;
	font-weight: 600;
}

.meal-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.food-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	background: #f0f0f0;
	border-radius: 10px;
	font-size: 11px;
	color: #333;
	white-space: nowrap;
}

.food-pill strong {
	color: #0073aa;
	font-weight: 600;
}

.no-meals {
	font-size: 11px;
	color: #999;
	font-style: italic;
}

.meal-summary-total {
	padding: 4px 10px;
	background: #e8f5e9;
	border-radius: 12px;
	font-size: 12px;
	color: #2e7d32;
	white-space: nowrap;
}

.meal-summary-total strong {
	font-weight: 600;
}

/* Counts-only display (no food pills) */
.meal-summary-group.counts-only {
	padding: 4px 10px;
	background: #f5f5f5;
	border-radius: 12px;
}

.meal-summary-group.counts-only .meal-summary-label {
	font-size: 12px;
}

/* Responsive adjustments for food summary */
@media (max-width: 1024px) {
	.food-summary-inline {
		flex-wrap: wrap;
		gap: 8px;
	}
}

@media (max-width: 768px) {
	.food-summary-inline {
		margin-left: 0;
		margin-top: 12px;
		width: 100%;
		padding-left: 0;
		border-left: none;
		border-top: 1px solid #e0e0e0;
		padding-top: 12px;
	}

	.meal-summary-group {
		flex-wrap: wrap;
	}
}

/* Check-in panel (today's workshops with QR button) */
.advisor-checkin-panel {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px 24px;
	margin-bottom: 24px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.advisor-checkin-panel__title {
	margin: 0 0 4px;
	font-size: 18px;
	color: #1e1e1e;
}

.advisor-checkin-panel__subtitle {
	margin: 0 0 16px;
	color: #555;
	font-size: 13px;
}

.advisor-checkin-panel__cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 12px;
}

.advisor-checkin-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 14px 16px;
	background: #fafafa;
}

.advisor-checkin-card__title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #1e1e1e;
}

.advisor-checkin-card__meta {
	margin: 4px 0 0;
	color: #666;
	font-size: 13px;
}

.advisor-checkin-card__venue {
	margin: 2px 0 0;
	color: #666;
	font-size: 13px;
}

.advisor-checkin-card__button {
	align-self: flex-start;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.advisor-checkin-card__button:hover,
.advisor-checkin-card__button:focus {
	background: #135e96;
}

/* Fullscreen QR modal */
.advisor-qr-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.advisor-qr-modal {
	background: #fff;
	border-radius: 12px;
	padding: 28px;
	max-width: 480px;
	width: 100%;
	text-align: center;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.advisor-qr-modal__label {
	color: #666;
	font-size: 13px;
	margin-bottom: 4px;
}

.advisor-qr-modal__title {
	font-size: 20px;
	font-weight: 600;
	color: #1e1e1e;
	margin-bottom: 2px;
}

.advisor-qr-modal__subtitle {
	color: #555;
	font-size: 14px;
	margin-bottom: 16px;
}

.advisor-qr-modal__image {
	display: block;
	width: 100%;
	max-width: 360px;
	aspect-ratio: 1 / 1;
	margin: 8px auto 12px;
}

.advisor-qr-modal__url {
	color: #888;
	font-size: 11px;
	word-break: break-all;
	margin-bottom: 18px;
}

.advisor-qr-modal__close {
	background: #1e1e1e;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.advisor-qr-modal__close:hover,
.advisor-qr-modal__close:focus {
	background: #000;
}
