/**
 * QuickCal Dog Profile Styles
 *
 * Styles for the My Dogs shortcode and dog profile management
 *
 * @package QuickCal
 * @since 1.4.0
 */

/* ==========================================================================
   CSS Custom Properties (Theme Integration)
   Themes can override these variables to customize appearance
   ========================================================================== */

:root {
	/* Primary colors - themes should override these */
	--quickcal-primary: var(--booked-primary-color, #56C477);
	--quickcal-primary-hover: var(--booked-button-color, #4ab069);
	--quickcal-secondary: var(--booked-secondary-color, #C9A962);

	/* Neutral colors */
	--quickcal-bg: #fff;
	--quickcal-bg-light: #f8f8f8;
	--quickcal-bg-dark: #fafafa;
	--quickcal-border: #e0e0e0;
	--quickcal-border-light: #eee;
	--quickcal-text: #333;
	--quickcal-text-secondary: #666;
	--quickcal-text-muted: #888;

	/* Spacing */
	--quickcal-space-1: 4px;
	--quickcal-space-2: 8px;
	--quickcal-space-3: 12px;
	--quickcal-space-4: 16px;
	--quickcal-space-5: 20px;

	/* Border radius */
	--quickcal-radius-sm: 6px;
	--quickcal-radius-md: 8px;
	--quickcal-radius-lg: 12px;
	--quickcal-radius-full: 9999px;
}

/* ==========================================================================
   My Dogs Shortcode
   ========================================================================== */

.quickcal-my-dogs {
	max-width: 100%;
}

.quickcal-my-dogs-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 10px;
}

.quickcal-my-dogs-header h3 {
	margin: 0;
	font-size: 1.5em;
}

.quickcal-add-dog-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 24px;
	background: linear-gradient(135deg, var(--quickcal-primary, #56C477) 0%, #45a866 100%);
	color: #fff !important;
	border: none !important;
	border-radius: 50px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.3px;
	cursor: pointer;
	box-shadow: 0 4px 15px rgba(86, 196, 119, 0.35);
	transition: all 0.3s ease;
}

.quickcal-add-dog-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(86, 196, 119, 0.45);
	background: linear-gradient(135deg, #5fd485 0%, var(--quickcal-primary, #56C477) 100%);
}

.quickcal-add-dog-btn:active {
	transform: translateY(0);
	box-shadow: 0 2px 10px rgba(86, 196, 119, 0.3);
}

.quickcal-add-dog-btn i {
	font-size: 14px;
	transition: transform 0.3s ease;
}

.quickcal-add-dog-btn:hover i {
	transform: rotate(90deg);
}

.quickcal-no-dogs {
	text-align: center;
	padding: 40px 20px;
	background: #f8f8f8;
	border-radius: 8px;
	color: #666;
}

/* Dogs Grid */
.quickcal-dogs-grid {
	display: grid;
	gap: 20px;
}

.quickcal-dogs-grid.columns-1 {
	grid-template-columns: 1fr;
}

.quickcal-dogs-grid.columns-2 {
	grid-template-columns: repeat(2, 1fr);
}

.quickcal-dogs-grid.columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
	.quickcal-dogs-grid.columns-2,
	.quickcal-dogs-grid.columns-3 {
		grid-template-columns: 1fr;
	}
}

/* Dog Card */
.quickcal-dog-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.quickcal-dog-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

/* Dog Photo */
.quickcal-dog-card .dog-photo {
	position: relative;
	width: 100%;
	height: 200px;
	overflow: hidden;
	background: #f0f0f0;
}

.quickcal-dog-card .dog-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.quickcal-dog-card .dog-photo-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.quickcal-dog-card .dog-photo:hover .dog-photo-overlay {
	opacity: 1;
}

.quickcal-dog-card .change-dog-photo {
	background: #fff;
	border: none;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 20px;
	color: #333;
	transition: transform 0.2s ease;
}

.quickcal-dog-card .change-dog-photo:hover {
	transform: scale(1.1);
}

/* Dog Info */
.quickcal-dog-card .dog-info {
	padding: 15px;
}

.quickcal-dog-card .dog-name {
	margin: 0 0 10px 0;
	font-size: 1.2em;
	font-weight: 600;
}

.quickcal-dog-card .dog-details {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

.quickcal-dog-card .dog-size {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 0.85em;
	font-weight: 500;
}

.quickcal-dog-card .dog-size-small {
	background: #e3f2fd;
	color: #1565c0;
}

.quickcal-dog-card .dog-size-medium_large {
	background: #fff3e0;
	color: #e65100;
}

.quickcal-dog-card .dog-breed,
.quickcal-dog-card .dog-weight {
	color: #666;
	font-size: 0.9em;
}

.quickcal-dog-card .dog-notes {
	color: #888;
	font-size: 0.85em;
	margin: 0;
	font-style: italic;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* Dog Actions */
.quickcal-dog-card .dog-actions {
	display: flex;
	gap: 10px;
	padding: 15px;
	border-top: 1px solid #eee;
	background: #fafafa;
}

.quickcal-dog-card .dog-actions button {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 12px;
	font-size: 0.9em;
	border-radius: 6px;
	cursor: pointer;
}

.quickcal-dog-card .quickcal-edit-dog {
	background: #f0f0f0;
	border: 1px solid #ddd;
	color: #333;
}

.quickcal-dog-card .quickcal-edit-dog:hover {
	background: #e0e0e0;
}

.quickcal-dog-card .quickcal-delete-dog {
	background: transparent;
	border: 1px solid #ffcdd2;
	color: #c62828;
}

.quickcal-dog-card .quickcal-delete-dog:hover {
	background: #ffebee;
}

/* ==========================================================================
   Dog Modal
   ========================================================================== */

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

.quickcal-dog-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.6);
}

.quickcal-dog-modal-content {
	position: relative;
	background: #fff;
	border-radius: 12px;
	width: 100%;
	max-width: 500px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

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

.quickcal-dog-modal-header h4 {
	margin: 0;
	font-size: 1.3em;
}

.quickcal-dog-modal-close {
	background: none;
	border: none;
	font-size: 28px;
	color: #999;
	cursor: pointer;
	padding: 0;
	line-height: 1;
}

.quickcal-dog-modal-close:hover {
	color: #333;
}

/* Dog Form */
.quickcal-dog-form {
	padding: 20px;
}

.quickcal-dog-form .form-row {
	margin-bottom: 20px;
}

.quickcal-dog-form label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
}

.quickcal-dog-form label .required {
	color: #c62828;
}

.quickcal-dog-form input[type="text"],
.quickcal-dog-form input[type="number"],
.quickcal-dog-form select,
.quickcal-dog-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 1em;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quickcal-dog-form input:focus,
.quickcal-dog-form select:focus,
.quickcal-dog-form textarea:focus {
	border-color: var(--booked-theme-color, #4a90d9);
	box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
	outline: none;
}

.quickcal-dog-form .field-description {
	margin: 6px 0 0;
	font-size: 0.85em;
	color: #888;
}

.quickcal-dog-form .form-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding-top: 10px;
	border-top: 1px solid #eee;
	margin-top: 20px;
}

/* Delete Confirmation */
.quickcal-delete-confirm {
	max-width: 400px;
}

.quickcal-delete-message {
	padding: 20px;
	text-align: center;
}

.quickcal-delete-message .delete-dog-name {
	font-weight: 600;
	font-size: 1.1em;
	color: #333;
}

.button-danger {
	background: #c62828 !important;
	border-color: #b71c1c !important;
	color: #fff !important;
}

.button-danger:hover {
	background: #b71c1c !important;
}

/* ==========================================================================
   Dog Selector (in Booking Form)
   ========================================================================== */

.quickcal-dog-selector {
	margin-bottom: 20px;
}

.quickcal-dog-selector h4 {
	margin: 0 0 15px 0;
	font-size: 1.1em;
}

.quickcal-dog-selector .saved-dogs {
	display: grid;
	gap: 10px;
}

.quickcal-dog-selector .dog-option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 15px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.quickcal-dog-selector .dog-option:hover {
	border-color: #bbb;
	background: #fafafa;
}

.quickcal-dog-selector .dog-option.selected {
	border-color: var(--booked-theme-color, #4a90d9);
	background: #e3f2fd;
}

.quickcal-dog-selector .dog-option input[type="checkbox"] {
	margin: 0;
}

.quickcal-dog-selector .dog-thumb {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}

.quickcal-dog-selector .dog-name {
	font-weight: 500;
	flex: 1;
}

.quickcal-dog-selector .dog-size {
	padding: 3px 8px;
	border-radius: 12px;
	font-size: 0.8em;
	background: #f0f0f0;
}

.quickcal-dog-selector .add-new-dog-inline {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #eee;
}

.quickcal-dog-selector .toggle-new-dog {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--booked-theme-color, #4a90d9);
	text-decoration: none;
	font-weight: 500;
}

.quickcal-dog-selector .toggle-new-dog:hover {
	text-decoration: underline;
}

.quickcal-dog-selector .new-dog-form {
	margin-top: 15px;
	padding: 15px;
	background: #f8f8f8;
	border-radius: 8px;
}

.quickcal-dog-selector .new-dog-form input,
.quickcal-dog-selector .new-dog-form select {
	margin-bottom: 10px;
}

/* ==========================================================================
   Admin Dog Size Badges
   ========================================================================== */

.dog-size-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
}

.dog-size-badge.small {
	background: #e3f2fd;
	color: #1565c0;
}

.dog-size-badge.medium-large {
	background: #fff3e0;
	color: #e65100;
}

/* ==========================================================================
   Admin Dog Selection
   ========================================================================== */

.quickcal-admin-dog-selection {
	margin-top: 15px;
	padding: 15px;
	background: #f9f9f9;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
}

.quickcal-admin-dog-selection label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #333;
}

.quickcal-admin-dog-selection select {
	width: 100%;
	max-width: 300px;
}

.quickcal-admin-add-dog {
	vertical-align: middle;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.quickcal-loading {
	text-align: center;
	padding: 40px 20px;
	color: #888;
}

.quickcal-error {
	color: #c62828;
	padding: 15px;
	text-align: center;
}

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

@media (max-width: 480px) {
	.quickcal-my-dogs-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.quickcal-dog-modal-content {
		margin: 10px;
		max-height: calc(100vh - 20px);
	}
}

/* ==========================================================================
   Photo Upload Loading State
   ========================================================================== */

.quickcal-dog-card .dog-photo.uploading {
	position: relative;
}

.quickcal-dog-card .dog-photo.uploading::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 10;
}

.quickcal-dog-card .dog-photo.uploading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	z-index: 11;
	animation: photoUploadSpin 0.8s linear infinite;
}

@keyframes photoUploadSpin {
	to {
		transform: rotate(360deg);
	}
}

/* Hide the hover overlay during upload */
.quickcal-dog-card .dog-photo.uploading .dog-photo-overlay {
	display: none !important;
}
