/**
 * Frontend Styles for NodoCoworking Reservas
 *
 * All classes are prefixed with .nc- to avoid conflicts.
 *
 * @package NodoCoworking_Reservas
 */

/* ==========================================================================
   Booking Form Wrapper
   ========================================================================== */

.nc-booking-form-wrapper {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.nc-booking-form {
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	padding: 30px;
}

/* ==========================================================================
   Form Sections
   ========================================================================== */

.nc-form-section {
	margin-bottom: 40px;
	padding-bottom: 30px;
	border-bottom: 1px solid #e5e5e5;
}

.nc-form-section:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.nc-section-title {
	font-size: 24px;
	font-weight: 600;
	margin: 0 0 20px 0;
	color: #333;
}

/* ==========================================================================
   Space Selection Grid
   ========================================================================== */

.nc-spaces-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	margin-top: 20px;
}

.nc-space-card {
	position: relative;
	border: 2px solid #e5e5e5;
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.3s ease;
	background: #fff;
}

.nc-space-card:hover {
	border-color: #0073aa;
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
	transform: translateY(-2px);
}

.nc-space-radio {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.nc-space-radio:checked + .nc-space-label {
	border-color: #0073aa;
	background-color: #f0f8ff;
}

.nc-space-radio:checked + .nc-space-label::after {
	content: "✓";
	position: absolute;
	top: 10px;
	right: 10px;
	width: 30px;
	height: 30px;
	background: #0073aa;
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 18px;
}

.nc-space-label {
	display: block;
	cursor: pointer;
	padding: 0;
	margin: 0;
	position: relative;
	height: 100%;
	border: 2px solid transparent;
	border-radius: 6px;
	transition: all 0.3s ease;
}

.nc-space-image {
	width: 100%;
	height: 180px;
	overflow: hidden;
	background: #f5f5f5;
}

.nc-space-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.nc-space-card:hover .nc-space-image img {
	transform: scale(1.05);
}

.nc-space-info {
	padding: 20px;
}

.nc-space-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 10px 0;
	color: #333;
}

.nc-space-excerpt {
	font-size: 14px;
	color: #666;
	margin: 0 0 10px 0;
	line-height: 1.5;
}

.nc-space-capacity {
	font-size: 14px;
	color: #666;
	margin: 5px 0;
	display: flex;
	align-items: center;
	gap: 5px;
}

.nc-space-capacity .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
}

.nc-space-price {
	font-size: 20px;
	font-weight: 700;
	color: #0073aa;
	margin: 10px 0 0 0;
}

.nc-price-period {
	font-size: 14px;
	font-weight: 400;
	color: #666;
}

.nc-no-spaces {
	text-align: center;
	padding: 40px 20px;
	color: #666;
	font-size: 16px;
}

/* ==========================================================================
   Form Fields
   ========================================================================== */

.nc-date-fields,
.nc-time-fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 20px;
	margin-top: 20px;
}

.nc-form-field {
	margin-bottom: 20px;
}

.nc-field-label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	color: #333;
	font-size: 14px;
}

.nc-required {
	color: #d63638;
	margin-left: 3px;
}

.nc-datepicker,
.nc-time-select {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.3s ease;
	background: #fff;
}

.nc-datepicker:focus,
.nc-time-select:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 1px #0073aa;
}

.nc-field-description {
	font-size: 13px;
	color: #666;
	margin: 5px 0 0 0;
	font-style: italic;
}

/* ==========================================================================
   Radio and Checkbox Groups
   ========================================================================== */

.nc-radio-group {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.nc-radio-label,
.nc-checkbox-label {
	display: flex;
	align-items: center;
	padding: 15px;
	border: 2px solid #e5e5e5;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.3s ease;
	background: #fff;
}

.nc-radio-label:hover,
.nc-checkbox-label:hover {
	border-color: #0073aa;
	background: #f0f8ff;
}

.nc-radio-label input[type="radio"],
.nc-checkbox-label input[type="checkbox"] {
	margin-right: 12px;
	width: 18px;
	height: 18px;
	cursor: pointer;
}

.nc-radio-label input[type="radio"]:checked + span,
.nc-checkbox-label input[type="checkbox"]:checked + .nc-extra-name {
	font-weight: 600;
	color: #0073aa;
}

.nc-radio-price,
.nc-extra-price {
	margin-left: auto;
	font-weight: 600;
	color: #0073aa;
}

.nc-extra-name {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
}

.nc-extra-name .dashicons {
	width: 20px;
	height: 20px;
	font-size: 20px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.nc-button {
	display: inline-block;
	padding: 14px 30px;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.3s ease;
	min-width: 200px;
}

.nc-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.nc-button-primary {
	background: #0073aa;
	color: #fff;
}

.nc-button-primary:hover:not(:disabled) {
	background: #005a87;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.nc-button-secondary {
	background: #fff;
	color: #0073aa;
	border: 2px solid #0073aa;
}

.nc-button-secondary:hover:not(:disabled) {
	background: #0073aa;
	color: #fff;
}

/* ==========================================================================
   Messages
   ========================================================================== */

.nc-form-messages {
	margin: 20px 0;
}

.nc-message {
	padding: 15px 20px;
	border-radius: 6px;
	margin-bottom: 15px;
	font-size: 14px;
	line-height: 1.5;
}

.nc-message-success {
	background: #d4edda;
	border: 1px solid #c3e6cb;
	color: #155724;
}

.nc-message-error {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
}

.nc-message-info {
	background: #d1ecf1;
	border: 1px solid #bee5eb;
	color: #0c5460;
}

.nc-availability-message {
	margin-top: 15px;
	font-size: 14px;
}

.nc-availability-message .nc-loading {
	color: #666;
	font-style: italic;
}

.nc-availability-message .nc-success {
	color: #155724;
	font-weight: 600;
}

.nc-availability-message .nc-error {
	color: #721c24;
	font-weight: 600;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
	.nc-booking-form {
		padding: 20px;
	}

	.nc-spaces-grid {
		grid-template-columns: 1fr;
	}

	.nc-date-fields,
	.nc-time-fields {
		grid-template-columns: 1fr;
	}

	.nc-section-title {
		font-size: 20px;
	}

	.nc-button {
		width: 100%;
		min-width: auto;
	}

	.nc-radio-label,
	.nc-checkbox-label {
		flex-wrap: wrap;
	}

	.nc-radio-price,
	.nc-extra-price {
		margin-left: 30px;
		width: 100%;
		text-align: left;
	}
}

@media (max-width: 480px) {
	.nc-booking-form-wrapper {
		padding: 10px;
	}

	.nc-booking-form {
		padding: 15px;
	}

	.nc-space-info {
		padding: 15px;
	}

	.nc-space-title {
		font-size: 16px;
	}

	.nc-space-price {
		font-size: 18px;
	}
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.nc-loading::after {
	content: "...";
	animation: nc-dots 1.5s steps(4, end) infinite;
}

@keyframes nc-dots {
	0%, 20% {
		content: ".";
	}
	40% {
		content: "..";
	}
	60%, 100% {
		content: "...";
	}
}

/* ==========================================================================
   jQuery UI Datepicker Overrides
   ========================================================================== */

.ui-datepicker {
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	padding: 10px;
}

.ui-datepicker-header {
	border-radius: 4px;
}

.ui-datepicker td a {
	text-align: center;
	border-radius: 4px;
}

.ui-datepicker td a.ui-state-active {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
}

.ui-datepicker td a:hover {
	background: #f0f8ff;
	border-color: #0073aa;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.nc-space-radio:focus + .nc-space-label,
.nc-radio-label:focus-within,
.nc-checkbox-label:focus-within {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* Screen reader only text */
.nc-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}
