/**
 * FashionPoint Services - Admin Styles
 *
 * WordPress admin interface styles following WordPress coding standards.
 * Uses WordPress admin color scheme variables for theme compatibility.
 *
 * @since 2.4.7
 * @package FashionPoint_Booking_System
 */

/* ==========================================================================
	Category Selection - Beautiful Modern Design
	========================================================================== */

/* Category Toggle Tabs */
.category-toggle-wrap {
	margin-bottom: 32px;
}

.category-toggle {
	display: flex;
	background: #f9fafb;
	border-radius: 16px;
	padding: 6px;
	gap: 6px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.toggle-btn {
	flex: 1;
	padding: 14px 28px;
	border: none;
	background: transparent;
	color: #475569;
	font-weight: 600;
	font-size: 15px;
	border-radius: 12px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	position: relative;
	overflow: hidden;
}

.toggle-btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: #d6a48f;
	opacity: 0;
	border-radius: 12px;
}

.toggle-btn.is-active {
	color: white;
	box-shadow: 0 2px 8px rgba(214, 164, 143, 0.3);
}

.toggle-btn.is-active::before {
	opacity: 1;
}

.toggle-btn.is-active span,
.toggle-btn.is-active svg {
	position: relative;
	z-index: 1;
}

.toggle-btn svg {
	width: 20px;
	height: 20px;
	transition: all 0.3s ease;
}

.toggle-btn.is-active svg {
	filter: brightness(0) invert(1);
}

/* Category Cards - Override conflicting styles */
.category-card {
	background: #ffffff !important;
	border: 1px solid #e5e7eb !important;
	border-radius: 20px !important;
	margin-bottom: 20px !important;
	cursor: pointer !important;
	overflow: hidden !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
	position: relative !important;
	width: 100% !important;
	min-height: auto !important;
	padding: 0 !important;
}


.category-header {
	padding: 16px 20px !important;
	position: relative !important;
}

.category-content {
	flex: 1 !important;
	display: flex !important;
	flex-direction: column !important;
}

.category-title-row {
	display: flex !important;
	flex-direction: row !important;
	justify-content: space-between !important;
	align-items: center !important;
	margin-bottom: 8px !important;
	gap: 16px !important;
	width: 100% !important;
	height: auto !important;
}

.category-name {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 18px !important;
	font-weight: 700 !important;
	color: #1a202c !important;
	line-height: 1.3 !important;
	letter-spacing: -0.02em !important;
	flex: 1 !important;
	min-width: 0 !important;
	display: block !important;
}

.category-expand-icon {
	width: 32px !important;
	height: 32px !important;
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	justify-content: center !important;
	border-radius: 50% !important;
	background: #f9fafb !important;
	flex-shrink: 0 !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
	margin-left: auto !important;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	position: relative !important;
}

.category-expand-icon svg {
	width: 18px !important;
	height: 18px !important;
	color: #475569 !important;
}

/* Services Container */
.category-services {
	border-top: 1px solid #e5e7eb;
	background: #f9fafb;
}

.services-list {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Service Items - Modern Design */
.service-item {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 16px;
	cursor: pointer;
	position: relative;
	overflow: hidden;
}

.service-item.selected {
	border-color: #d6a48f;
	background: #fafafa;
	box-shadow: 0 1px 3px rgba(214, 164, 143, 0.2);
}

.service-item.selected::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: #d6a48f;
}

.service-info {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.service-main {
	flex: 1;
	min-width: 0;
}

.service-title {
	display: block;
	font-weight: 600;
	font-size: 15px;
	color: #333333;
	line-height: 1.4;
	margin-bottom: 4px;
}

.service-details {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	font-size: 14px;
	color: #666666;
	font-weight: 500;
}

.service-duration {
	display: block;
}

.service-price {
	display: block;
	font-weight: 600;
	color: #333333;
}

/* Time Slots */
.timeslots-section {
	margin-top: 2rem;
	padding: 1.5rem;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	border: 1px solid #e5e7eb;
}

.timeslots-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: #2d3748;
	margin-bottom: 1rem;
}

.timeslots-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 0.75rem;
}

.timeslot-button {
	padding: 0.75rem 1rem;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	background: #ffffff;
	color: #475569;
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
	overflow: hidden;
}

.timeslot-button:hover {
	border-color: #d6a48f;
	color: #d6a48f;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(214, 164, 143, 0.15);
}

.timeslot-button.selected {
	background: #d6a48f;
	color: #ffffff;
	border-color: #d6a48f;
	transform: translateY(0);
	box-shadow: 0 2px 8px rgba(214, 164, 143, 0.3);
}

.timeslot-button.selected::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
}

.timeslot-button:disabled {
	background: #f8fafc;
	color: #a0aec0;
	border-color: #e2e8f0;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.timeslot-button:disabled:hover {
	border-color: #e2e8f0;
	color: #a0aec0;
	transform: none;
	box-shadow: none;
}

.timeslot-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	color: #64748b;
}

.timeslot-loading .spinner {
	width: 32px;
	height: 32px;
	border: 3px solid #e5e7eb;
	border-top-color: #d6a48f;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: 1rem;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.timeslots-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	color: #64748b;
	text-align: center;
}

.timeslots-empty svg {
	width: 48px;
	height: 48px;
	color: #cbd5e1;
	margin-bottom: 1rem;
}

.timeslots-empty p {
	font-size: 0.875rem;
	line-height: 1.5;
	margin: 0;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
	.category-card {
		margin-bottom: 16px !important;
		border-radius: 16px !important;
	}

	.category-header {
		padding: 16px !important;
	}

	.category-title-row {
		flex-direction: row !important;
		align-items: center !important;
		gap: 12px !important;
	}

	.category-name {
		font-size: 16px !important;
		flex: 1 !important;
	}

	.category-expand-icon {
		width: 28px !important;
		height: 28px !important;
		flex-shrink: 0 !important;
	}

	.category-expand-icon svg {
		width: 16px !important;
		height: 16px !important;
	}

	.category-description {
		font-size: 13px !important;
		margin-bottom: 0 !important;
	}

	.services-list {
		padding: 16px !important;
		gap: 10px !important;
	}

	.service-item {
		padding: 14px !important;
		border-radius: 10px !important;
	}

	.service-info {
		flex-direction: column !important;
		align-items: flex-start !important;
		gap: 12px !important;
	}

	.service-main {
		width: 100% !important;
	}
}

@media (max-width: 480px) {
	.category-header {
		padding: 12px !important;
	}

	.category-name {
		font-size: 15px !important;
	}

	.category-expand-icon {
		width: 26px !important;
		height: 26px !important;
	}

	.services-list {
		padding: 12px !important;
		gap: 8px !important;
	}

	.service-item {
		padding: 12px !important;
	}

	.service-title {
		font-size: 13px !important;
	}

	.service-details {
		font-size: 12px !important;
	}
}

/* Service Items */
.service-item {
	background: white;
	border: 1px solid #e9ecef;
	border-radius: 12px;
	padding: 16px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	position: relative;
	overflow: hidden;
}

.service-item::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(90deg, #d6a48f 0%, #d6a48f 100%);
	transform: scaleX(0);
	transition: transform 0.3s ease;
}

.service-item.selected {
	border-color: #d6a48f;
	background: #fafafa;
	box-shadow: 0 4px 12px rgba(214, 164, 143, 0.15);
}

.service-item.selected::before {
	transform: scaleX(1);
	background: #d6a48f;
}

.service-info {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
}

.service-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.service-title {
	font-weight: 600;
	color: #2d3748;
	font-size: 15px;
	line-height: 1.4;
}

.service-details {
	font-size: 13px;
	color: #718096;
	font-weight: 500;
}

/* Beautiful Custom Checkboxes */
.service-select {
	flex-shrink: 0;
}

.service-select .checkbox {
	position: relative;
}

.service-select .checkbox input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	cursor: pointer;
	width: 0;
	height: 0;
}

.service-select .checkbox label {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border: 2px solid #e9ecef;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	background: white;
	position: relative;
}


.service-select .checkbox input[type="checkbox"]:checked + label {
	background: #d6a48f;
	border-color: #d6a48f;
	animation: checkPulse 0.4s ease;
}

@keyframes checkPulse {
	0% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.1);
	}
	100% {
		transform: scale(1);
	}
}

.service-select .checkbox input[type="checkbox"]:checked + label svg {
	stroke: white;
	animation: checkmark 0.3s ease;
}

@keyframes checkmark {
	0% {
		opacity: 0;
		transform: translate(-50%, -50%) scale(0.5);
	}
	50% {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1.1);
	}
	100% {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
	}
}

.service-select .checkbox svg {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
	opacity: 0;
	transition: all 0.3s ease;
	width: 14px;
	height: 14px;
}

.service-select .checkbox input[type="checkbox"]:checked + label svg {
	opacity: 1;
}

/* No Services State */
.no-services {
	text-align: center;
	padding: 32px;
	color: #718096;
	font-style: italic;
}

.no-services p {
	margin: 0;
	font-size: 14px;
}

/* Selection Summary */
.selection-summary {
	margin-top: 24px;
	padding: 20px;
	background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
	border: 1px solid rgba(102, 126, 234, 0.2);
	border-radius: 16px;
	backdrop-filter: blur(10px);
}

.selected-category {
	margin-bottom: 12px;
}

.selected-category span {
	font-weight: 600;
	color: #d6a48f;
	font-size: 16px;
}

.selected-services-summary {
	padding-top: 16px;
	border-top: 1px solid rgba(214, 164, 143, 0.2);
}

.services-count {
	font-size: 14px;
	color: #718096;
	margin-bottom: 12px;
	font-weight: 500;
}

.total-duration,
.total-price {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	margin-bottom: 6px;
	font-weight: 500;
}

.total-duration svg,
.total-price .price-label {
	color: #718096;
}

.total-duration span,
.total-price .price-amount {
	font-weight: 700;
	color: #2d3748;
	font-size: 15px;
}

.total-price .price-amount {
	color: #d6a48f;
}

/* Responsive Design */
@media (max-width: 768px) {
	.category-header {
		padding: 16px;
	}

	.category-services {
		padding: 12px;
	}

	.service-item {
		padding: 14px;
	}

	.service-info {
		gap: 12px;
	}

	.toggle-btn {
		padding: 10px 16px;
		font-size: 13px;
	}

	.category-name {
		font-size: 16px;
	}

	.service-title {
		font-size: 14px;
	}
}

/* ==========================================================================
	Admin Layout and Structure
	========================================================================== */

/* Hide next button on location selection step */
.fp-booking[data-current-step="1"] .fp-booking__next {
	display: none !important;
}

/* Ensure next button is visible on category selection step */
.fp-booking[data-current-step="2"] .fp-booking__next {
	display: inline-flex !important;
}

.fashionpoint-admin-layout {
	display: flex;
	gap: 24px;
	align-items: flex-start;
}

.fashionpoint-admin-column {
	flex: 1;
}

.fashionpoint-admin-list-container {
	max-height: 260px;
	overflow: auto;
	border: 1px solid #ddd;
	padding: 8px;
	background: #fff;
}

.fashionpoint-admin-label {
	display: block;
	margin-bottom: 6px;
}

.fashionpoint-admin-order-list {
	border: 1px solid #ddd;
	padding: 8px;
	max-height: 180px;
	overflow: auto;
	background: #fff;
}

.fashionpoint-admin-margin-top {
	margin-top: 16px;
}

/* ==========================================================================
	Admin Form Styles
	========================================================================== */

.fashionpoint-admin-form {
	margin-bottom: 12px;
}

.fashionpoint-admin-label-inline {
	margin-left: 10px;
}

/* ==========================================================================
	Debug and Info Messages (WordPress Admin Standards)
	========================================================================== */

.fashionpoint-debug-success {
	background: #e8f5e8;
	padding: 10px;
	margin: 10px;
	border: 1px solid #4caf50;
	border-left-width: 4px;
	border-left-style: solid;
}

.fashionpoint-debug-info {
	background: #e3f2fd;
	padding: 10px;
	margin: 10px;
	border: 1px solid #2196f3;
	border-left-width: 4px;
	border-left-style: solid;
}

.fashionpoint-debug-warning {
	background: #fff3cd;
	padding: 10px;
	margin: 10px;
	border: 1px solid #ffc107;
	border-left-width: 4px;
	border-left-style: solid;
}

.fashionpoint-debug-error {
	background: #ffebee;
	padding: 10px;
	margin: 10px;
	border: 1px solid #f44336;
	border-left-width: 4px;
	border-left-style: solid;
}

.fashionpoint-debug-code {
	background: #111;
	color: #0f0;
	padding: 12px;
	overflow: auto;
	font-family: monospace;
	font-size: 13px;
	border-radius: 4px;
}

.fashionpoint-debug-code-warning {
	background: #111;
	color: #f90;
	padding: 12px;
	overflow: auto;
	font-family: monospace;
	font-size: 13px;
	border-radius: 4px;
}

/* ==========================================================================
	Color Settings Section
	========================================================================== */

.fashionpoint-colors-layout {
	display: flex;
	gap: 40px;
	align-items: flex-start;
	justify-content: space-between;
}

.fashionpoint-colors-column {
	flex: 1;
}

.fashionpoint-reset-button {
	white-space: nowrap;
}

/* ==========================================================================
	Categories Selection
	========================================================================== */

.fashionpoint-categories-container {
	max-height: 300px;
	overflow-y: auto;
	border: 1px solid #ddd;
	padding: 10px;
	background: white;
}

.fashionpoint-categories-description {
	margin-bottom: 10px;
}

.fashionpoint-category-label {
	display: block;
	margin-bottom: 5px;
}

.fashionpoint-category-code {
	font-size: 11px;
}

/* ==========================================================================
	Responsive Admin Styles
	========================================================================== */

@media (max-width: 768px) {
	.fashionpoint-admin-layout {
		flex-direction: column;
		gap: 16px;
	}

	.fashionpoint-colors-layout {
		flex-direction: column;
		gap: 20px;
	}

	.fashionpoint-admin-list-container {
		max-height: 200px;
	}

	.fashionpoint-admin-order-list {
		max-height: 150px;
	}
}

@media (max-width: 480px) {
	.fashionpoint-admin-layout {
		gap: 12px;
	}

	.fashionpoint-colors-layout {
		gap: 16px;
	}

	.fashionpoint-admin-list-container {
		max-height: 180px;
		padding: 6px;
	}

	.fashionpoint-admin-order-list {
		max-height: 120px;
		padding: 6px;
	}
}

/* ==========================================================================
	WordPress Admin Theme Compatibility
	========================================================================== */

/* Use WordPress admin color scheme variables when available */
:root {
	--fashionpoint-admin-primary: var(--wp-admin-theme-color, #0073aa);
	--fashionpoint-admin-primary-hover: var(--wp-admin-theme-color-darker-10, #006799);
	--fashionpoint-admin-text: var(--wp-admin-theme-text, #1e1e1e);
	--fashionpoint-admin-border: var(--wp-admin-theme-border, #c3c4c7);
	--fashionpoint-admin-background: var(--wp-admin-theme-background, #fff);
}

.fashionpoint-admin-button-primary {
	background-color: var(--fashionpoint-admin-primary);
	color: #fff;
	border-color: var(--fashionpoint-admin-primary);
}

.fashionpoint-admin-button-primary:hover {
	background-color: var(--fashionpoint-admin-primary-hover);
	border-color: var(--fashionpoint-admin-primary-hover);
}

.fashionpoint-admin-border {
	border-color: var(--fashionpoint-admin-border);
}

.fashionpoint-admin-background {
	background-color: var(--fashionpoint-admin-background);
}

.fashionpoint-admin-text {
	color: var(--fashionpoint-admin-text);
}
