/**
 * Admin Styles for Tour Guide Service
 *
 * @package tr-guide-service
 */

/* Dashboard Tabs */
.trgs-dashboard-tabs,
.trgs-admin-tabs {
	margin-bottom: 20px;
	border-bottom: 1px solid #ccc;
	padding-bottom: 10px;
}

.trgs-dashboard-tabs .tab-button,
.trgs-admin-tabs .tab-button {
	background: none;
	border: none;
	padding: 10px 20px;
	cursor: pointer;
	font-size: 14px;
	border-bottom: 3px solid transparent;
}

.trgs-dashboard-tabs .tab-button.active,
.trgs-admin-tabs .tab-button.active {
	border-bottom-color: #0073aa;
	font-weight: bold;
}

/* Tab Content */
.tab-content {
	display: none;
}

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

/* Status Badges */
.status-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: bold;
}

.status-pending {
	background: #fff3cd;
	color: #856404;
}

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

.status-rejected {
	background: #f8d7da;
	color: #721c24;
}

.status-completed {
	background: #cce5ff;
	color: #004085;
}

.status-cancelled {
	background: #e2e3e5;
	color: #383d41;
}

/* Badges */
.badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: bold;
}

.badge-coordinator {
	background: #0073aa;
	color: white;
}

.badge-disabled {
	background: #dc3545;
	color: white;
}

.badge-active {
	background: #28a745;
	color: white;
}

/* Dashboard Stats */
.trgs-admin-dashboard {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin-top: 20px;
}

.trgs-stat-card {
	background: white;
	border: 1px solid #ccc;
	padding: 20px;
	border-radius: 5px;
	text-align: center;
}

.trgs-stat-card h3 {
	margin-top: 0;
	font-size: 16px;
	color: #666;
}

.trgs-stat-card .stat-number {
	font-size: 36px;
	font-weight: bold;
	color: #0073aa;
	margin: 10px 0;
}

/* Form Groups */
.form-group {
	margin-bottom: 15px;
}

.form-group label {
	display: block;
	margin-bottom: 5px;
	font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
	width: 100%;
	padding: 8px;
	border: 1px solid #ccc;
	border-radius: 3px;
}

/* Availability Calendar */
#availability-calendar {
	margin-bottom: 20px;
}

.calendar-controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

#calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 5px;
}

.calendar-day {
	padding: 10px;
	text-align: center;
	border: 1px solid #ddd;
	background: white;
	cursor: pointer;
}

.calendar-day:hover {
	background: #f0f0f0;
}

.calendar-day.unavailable {
	background: #f8d7da;
}

.calendar-day.today {
	background: #cce5ff;
	font-weight: bold;
}

/* Unavailability List */
#unavailability-list {
	list-style: none;
	padding: 0;
}

#unavailability-list li {
	padding: 10px;
	border-bottom: 1px solid #ddd;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

#unavailability-list li button {
	margin-left: 10px;
}

/* Messages */
#trgs-registration-message,
#profile-message {
	margin-top: 15px;
}

/* Modal */
#assignment-modal {
	z-index: 99999;
}

#assignment-modal > div {
	box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#assignment-modal table {
	margin-bottom: 15px;
}

#assignment-modal th,
#assignment-modal td {
	padding: 8px;
}

/* Responsive */
@media (max-width: 768px) {
	.trgs-admin-dashboard {
		grid-template-columns: 1fr;
	}
	
	.trgs-dashboard-tabs .tab-button,
	.trgs-admin-tabs .tab-button {
		padding: 10px 10px;
		font-size: 12px;
	}
}

/* Guide Availability */
.trgs-availability-layout {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.trgs-availability-hours-col {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 16px;
	box-sizing: border-box;
	width: 100%;
}

.trgs-hours-warning {
	color: #dc3232;
	background: #fdecea;
	border: 1px solid #dc3232;
	border-radius: 4px;
	padding: 10px 14px;
	margin-bottom: 15px;
}

.trgs-hours-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.trgs-hours-header-title h3 {
	margin: 0 0 4px 0;
}

.trgs-hours-header-title .description {
	margin: 0;
}

.trgs-hours-header-timezone {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 0;
}

.trgs-hours-header-timezone label {
	margin-bottom: 0;
	white-space: nowrap;
	font-weight: 600;
}

.trgs-hours-header-timezone select {
	width: auto;
	min-width: 220px;
}

.trgs-hours-header-save {
	flex-shrink: 0;
}

.trgs-hours-rows {
	margin-bottom: 15px;
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	grid-template-rows: auto auto;
	column-gap: 14px;
	row-gap: 10px;
}

.trgs-hours-row {
	display: contents;
}

.trgs-hours-row:nth-child(1) .trgs-day-toggle,
.trgs-hours-row:nth-child(1) .trgs-hours-times,
.trgs-hours-row:nth-child(1) .trgs-day-closed { grid-column: 1; }
.trgs-hours-row:nth-child(2) .trgs-day-toggle,
.trgs-hours-row:nth-child(2) .trgs-hours-times,
.trgs-hours-row:nth-child(2) .trgs-day-closed { grid-column: 2; }
.trgs-hours-row:nth-child(3) .trgs-day-toggle,
.trgs-hours-row:nth-child(3) .trgs-hours-times,
.trgs-hours-row:nth-child(3) .trgs-day-closed { grid-column: 3; }
.trgs-hours-row:nth-child(4) .trgs-day-toggle,
.trgs-hours-row:nth-child(4) .trgs-hours-times,
.trgs-hours-row:nth-child(4) .trgs-day-closed { grid-column: 4; }
.trgs-hours-row:nth-child(5) .trgs-day-toggle,
.trgs-hours-row:nth-child(5) .trgs-hours-times,
.trgs-hours-row:nth-child(5) .trgs-day-closed { grid-column: 5; }
.trgs-hours-row:nth-child(6) .trgs-day-toggle,
.trgs-hours-row:nth-child(6) .trgs-hours-times,
.trgs-hours-row:nth-child(6) .trgs-day-closed { grid-column: 6; }
.trgs-hours-row:nth-child(7) .trgs-day-toggle,
.trgs-hours-row:nth-child(7) .trgs-hours-times,
.trgs-hours-row:nth-child(7) .trgs-day-closed { grid-column: 7; }

.trgs-hours-row .trgs-day-toggle { grid-row: 1; }
.trgs-hours-row .trgs-hours-times,
.trgs-hours-row .trgs-day-closed { grid-row: 2; }

.trgs-day-toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	width: auto;
	flex-shrink: 0;
	font-weight: 600;
	white-space: nowrap;
}

.trgs-hours-times {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

.trgs-hours-times input[type="time"] {
	width: 100px;
	box-sizing: border-box;
	font-size: 13px;
	padding: 4px 6px;
}

@media (max-width: 900px) {
	.trgs-hours-rows {
		grid-template-columns: repeat(3, 1fr);
	}
	.trgs-hours-row:nth-child(1) .trgs-day-toggle,
	.trgs-hours-row:nth-child(1) .trgs-hours-times,
	.trgs-hours-row:nth-child(1) .trgs-day-closed,
	.trgs-hours-row:nth-child(4) .trgs-day-toggle,
	.trgs-hours-row:nth-child(4) .trgs-hours-times,
	.trgs-hours-row:nth-child(4) .trgs-day-closed,
	.trgs-hours-row:nth-child(7) .trgs-day-toggle,
	.trgs-hours-row:nth-child(7) .trgs-hours-times,
	.trgs-hours-row:nth-child(7) .trgs-day-closed { grid-column: 1; }
	.trgs-hours-row:nth-child(2) .trgs-day-toggle,
	.trgs-hours-row:nth-child(2) .trgs-hours-times,
	.trgs-hours-row:nth-child(2) .trgs-day-closed,
	.trgs-hours-row:nth-child(5) .trgs-day-toggle,
	.trgs-hours-row:nth-child(5) .trgs-hours-times,
	.trgs-hours-row:nth-child(5) .trgs-day-closed { grid-column: 2; }
	.trgs-hours-row:nth-child(3) .trgs-day-toggle,
	.trgs-hours-row:nth-child(3) .trgs-hours-times,
	.trgs-hours-row:nth-child(3) .trgs-day-closed,
	.trgs-hours-row:nth-child(6) .trgs-day-toggle,
	.trgs-hours-row:nth-child(6) .trgs-hours-times,
	.trgs-hours-row:nth-child(6) .trgs-day-closed { grid-column: 3; }
}

.trgs-day-closed {
	color: #8c8f94;
	background: #f0f0f1;
	padding: 3px 10px;
	border-radius: 3px;
	font-size: 12px;
}

/* Legend */
.trgs-calendar-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 15px;
}

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

.legend-swatch {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 3px;
	border: 1px solid rgba(0,0,0,0.15);
}

.legend-available { background: #46b450; }
.legend-partially { background: repeating-linear-gradient(45deg, #46b450, #46b450 4px, #ffffff 4px, #ffffff 8px); }
.legend-unavailable { background: #dc3232; }
.legend-booked { background: #ffb900; }
.legend-pending { background: #f5a3a3; }

/* Calendar grid */
.trgs-calendar-months {
	display: block;
	margin-bottom: 20px;
}

.trgs-cal-month {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 16px;
}

.trgs-cal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.trgs-cal-nav {
	background: none;
	border: 1px solid #dcdcde;
	border-radius: 3px;
	padding: 4px 12px;
	cursor: pointer;
	font-size: 18px;
	color: #1d2327;
}

.trgs-cal-nav:hover {
	background: #f0f0f1;
}

.trgs-cal-title {
	font-size: 18px;
	font-weight: 700;
	text-align: center;
}

.trgs-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.trgs-cal-dow {
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	color: #8c8f94;
	padding-bottom: 4px;
}

.trgs-cal-day {
	min-height: 220px;
	padding: 8px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	font-size: 14px;
	font-weight: 600;
	border-radius: 4px;
	cursor: pointer;
	user-select: none;
	color: #1d2327;
	background: #f0f0f1;
	border: 1px solid #dcdcde;
	position: relative;
}

.trgs-cal-day-empty {
	background: transparent;
	cursor: default;
}

.trgs-status-available { background: #fff; color: #1d2327; }
.trgs-status-unavailable { background: #dc3232; color: #fff; }
.trgs-status-closed { background: #e5e5e5; color: #8c8f94; }

.trgs-status-available .trgs-day-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #46b450;
	color: #fff;
}

.trgs-cal-day.trgs-cal-selected {
	outline: 3px solid #1d2327;
	outline-offset: -3px;
}

.trgs-cal-day.trgs-cal-today .trgs-day-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 2px solid #1d2327;
	font-weight: 700;
}

.trgs-day-number {
	font-size: 16px;
	font-weight: 700;
	margin-bottom: 4px;
}

.trgs-block-row {
	display: flex;
	align-items: center;
	width: 100%;
	margin-bottom: 3px;
}

.trgs-block-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #dc3232;
	margin-right: 4px;
	vertical-align: middle;
	flex-shrink: 0;
}

.trgs-dot-booked {
	background: #ffb900;
}

.trgs-dot-pending {
	background: #f5a3a3;
}

.trgs-block-time {
	font-size: 10px;
	font-weight: 400;
	color: inherit;
	line-height: 1.3;
	word-wrap: break-word;
}

.trgs-calendar-actions {
	display: flex;
	gap: 10px;
	margin-bottom: 15px;
}

.trgs-date-range-form {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 16px;
	margin-bottom: 15px;
	max-width: 420px;
}

.trgs-date-range-form .form-group {
	margin-bottom: 10px;
}

.trgs-date-range-form input[type="date"],
.trgs-date-range-form input[type="time"] {
	margin-right: 8px;
}

/* Day Details Panel */
.trgs-day-details {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 16px;
	margin-top: 15px;
	max-width: 420px;
}

.trgs-day-details h4 {
	margin-top: 0;
	margin-bottom: 12px;
	font-size: 16px;
}

.trgs-blocks-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.trgs-blocks-list li {
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f1;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.trgs-blocks-list li:last-child {
	border-bottom: none;
}

.trgs-blocks-list .button-small {
	margin-left: 10px;
}
