/**
 * Summary Card Component Styles
 *
 * Booking summary card with progress indicators
 *
 * @package MphbGuestServices
 * @since 2.0.0
 */

.gs-summary-card {
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid var(--gs-color-border, #e5e7eb);
	background: var(--gs-color-surface, #fff);
	box-shadow: var(--gs-shadow-md, 0 10px 30px rgba(15, 23, 42, 0.08));
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Progress Section */
.gs-summary-progress {
	padding: 0 16px 12px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.gs-progress-labels {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--gs-color-text-soft, #64748b);
	font-weight: 600;
}

.gs-progress-track {
	position: relative;
	height: 10px;
	border-radius: 999px;
	background: #e2e8f0;
	overflow: hidden;
}

.gs-progress-fill {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	background: linear-gradient(90deg, #0ea5e9, #22c55e);
	border-radius: 999px;
	width: var(--gs-progress, 0%);
	transition: width 0.3s ease;
}

.gs-progress-thumb {
	position: absolute;
	top: 50%;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--gs-color-text, #0f172a);
	border: 3px solid #e2e8f0;
	transform: translate(-50%, -50%);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
	left: var(--gs-progress, 0%);
	transition: left 0.3s ease;
}

.gs-progress-meta {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--gs-color-text-soft, #64748b);
	font-weight: 600;
}

/* Stats Grid */
.gs-summary-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	padding: 0 16px 16px;
}

.gs-summary-stat {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border: 1px solid var(--gs-color-border, #e2e8f0);
	border-radius: 10px;
	background: var(--gs-color-surface-alt, #f8fafc);
}

.gs-summary-icon {
	width: 26px;
	height: 26px;
	border-radius: 8px;
	background: var(--gs-color-surface, #fff);
	color: var(--gs-color-text-soft, #334155);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border: 1px solid var(--gs-color-border, #e2e8f0);
}

.gs-summary-icon svg {
	width: 16px;
	height: 16px;
}

@media (max-width: 768px) {
	.gs-summary-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 480px) {
	.gs-summary-stats {
		grid-template-columns: 1fr;
	}
}

/* ========================================
 * Stay Countdown Component
 * ======================================== */

.gs-stay-countdown {
	margin: 0 16px 16px;
	padding: 20px 24px;
	border-radius: 16px;
	display: flex;
	align-items: center;
	gap: 20px;
	position: relative;
	overflow: hidden;
	animation: gs-countdown-fade-in 0.5s ease-out;
}

@keyframes gs-countdown-fade-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Animated background shimmer */
.gs-stay-countdown::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		110deg,
		transparent 20%,
		rgba(255, 255, 255, 0.15) 40%,
		rgba(255, 255, 255, 0.15) 60%,
		transparent 80%
	);
	background-size: 200% 100%;
	animation: gs-countdown-shimmer 3s ease-in-out infinite;
}

@keyframes gs-countdown-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Arrival countdown - Green theme */
.gs-stay-countdown--arrival {
	background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
	box-shadow:
		0 4px 20px rgba(16, 185, 129, 0.35),
		0 0 0 1px rgba(16, 185, 129, 0.2),
		inset 0 1px 0 rgba(255, 255, 255, 0.2);
	color: #fff;
}

.gs-stay-countdown--arrival .gs-stay-countdown__icon {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
}

/* Welcome message - Green with glow */
.gs-stay-countdown--welcome {
	background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
	box-shadow:
		0 4px 30px rgba(16, 185, 129, 0.5),
		0 0 60px rgba(52, 211, 153, 0.3),
		inset 0 1px 0 rgba(255, 255, 255, 0.2);
	color: #fff;
	justify-content: center;
}

.gs-stay-countdown--welcome .gs-stay-countdown__icon {
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
	animation: gs-countdown-pulse 2s ease-in-out infinite;
}

.gs-stay-countdown--welcome .gs-stay-countdown__label {
	font-size: 28px;
	letter-spacing: 1px;
}

/* Departure countdown - Red theme */
.gs-stay-countdown--departure {
	background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #f87171 100%);
	box-shadow:
		0 4px 20px rgba(239, 68, 68, 0.35),
		0 0 0 1px rgba(239, 68, 68, 0.2),
		inset 0 1px 0 rgba(255, 255, 255, 0.2);
	color: #fff;
}

.gs-stay-countdown--departure .gs-stay-countdown__icon {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
}

/* Safe travels message - Red with glow */
.gs-stay-countdown--safe_travels {
	background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #f87171 100%);
	box-shadow:
		0 4px 30px rgba(239, 68, 68, 0.5),
		0 0 60px rgba(248, 113, 113, 0.3),
		inset 0 1px 0 rgba(255, 255, 255, 0.2);
	color: #fff;
	justify-content: center;
}

.gs-stay-countdown--safe_travels .gs-stay-countdown__icon {
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
	animation: gs-countdown-pulse 2s ease-in-out infinite;
}

.gs-stay-countdown--safe_travels .gs-stay-countdown__label {
	font-size: 28px;
	letter-spacing: 1px;
}

@keyframes gs-countdown-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.1); }
}

/* Icon */
.gs-stay-countdown__icon {
	width: 56px;
	height: 56px;
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
}

.gs-stay-countdown__icon svg {
	width: 28px;
	height: 28px;
}

/* Content */
.gs-stay-countdown__content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
	position: relative;
	z-index: 1;
}

.gs-stay-countdown__label {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	opacity: 0.9;
}

/* Timer display */
.gs-stay-countdown__timer {
	margin: 0;
	display: flex;
	align-items: baseline;
	gap: 2px;
	font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
	flex-wrap: nowrap;
}

/* Expected arrival hour under the arrival countdown timer
   (« Arrivée prévue %s ») — margin stacks on the 4px content gap
   (12px total), the card's own 16px bottom margin follows. */
.gs-summary-countdown__note {
	margin: 8px 0 0;
	font-size: 13px;
	font-weight: 600;
	opacity: 0.85;
}

.gs-countdown-segment {
	display: inline-flex;
	align-items: baseline;
	flex-shrink: 0;
}

.gs-countdown-value {
	font-size: 28px;
	font-weight: 700;
	line-height: 1;
	min-width: 2ch;
	text-align: center;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gs-countdown-unit {
	font-size: 12px;
	font-weight: 600;
	opacity: 0.7;
	margin-left: 1px;
}

.gs-countdown-separator {
	font-size: 24px;
	font-weight: 700;
	opacity: 0.6;
	margin: 0 1px;
	animation: gs-countdown-blink 1s ease-in-out infinite;
}

@keyframes gs-countdown-blink {
	0%, 100% { opacity: 0.6; }
	50% { opacity: 0.2; }
}

/* Seconds special styling - pulsing effect */
.gs-countdown-segment:last-child .gs-countdown-value {
	animation: gs-seconds-pulse 1s ease-in-out infinite;
}

@keyframes gs-seconds-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.7; }
}

/* Responsive */
@media (max-width: 480px) {
	.gs-stay-countdown {
		flex-direction: column;
		text-align: center;
		padding: 16px;
	}

	.gs-stay-countdown__icon {
		width: 48px;
		height: 48px;
	}

	.gs-stay-countdown__icon svg {
		width: 24px;
		height: 24px;
	}

	.gs-countdown-value {
		font-size: 32px;
	}

	.gs-countdown-separator {
		font-size: 28px;
	}

	.gs-countdown-unit {
		font-size: 14px;
	}

	.gs-stay-countdown--welcome .gs-stay-countdown__label,
	.gs-stay-countdown--safe_travels .gs-stay-countdown__label {
		font-size: 22px;
	}
}

/* ========================================
 * Dark Mode Support
 * ======================================== */

/* Dark theme */
.mphb-gs-shell[data-theme="dark"] .gs-stay-countdown--arrival {
	background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%);
	box-shadow:
		0 4px 24px rgba(16, 185, 129, 0.4),
		0 0 0 1px rgba(52, 211, 153, 0.3),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mphb-gs-shell[data-theme="dark"] .gs-stay-countdown--welcome {
	background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%);
	box-shadow:
		0 4px 40px rgba(16, 185, 129, 0.6),
		0 0 80px rgba(52, 211, 153, 0.4),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mphb-gs-shell[data-theme="dark"] .gs-stay-countdown--departure {
	background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #ef4444 100%);
	box-shadow:
		0 4px 24px rgba(239, 68, 68, 0.4),
		0 0 0 1px rgba(248, 113, 113, 0.3),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mphb-gs-shell[data-theme="dark"] .gs-stay-countdown--safe_travels {
	background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #ef4444 100%);
	box-shadow:
		0 4px 40px rgba(239, 68, 68, 0.6),
		0 0 80px rgba(248, 113, 113, 0.4),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Auto theme (follows system preference) */
@media (prefers-color-scheme: dark) {
	.mphb-gs-shell[data-theme="auto"] .gs-stay-countdown--arrival {
		background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%);
		box-shadow:
			0 4px 24px rgba(16, 185, 129, 0.4),
			0 0 0 1px rgba(52, 211, 153, 0.3),
			inset 0 1px 0 rgba(255, 255, 255, 0.1);
	}

	.mphb-gs-shell[data-theme="auto"] .gs-stay-countdown--welcome {
		background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%);
		box-shadow:
			0 4px 40px rgba(16, 185, 129, 0.6),
			0 0 80px rgba(52, 211, 153, 0.4),
			inset 0 1px 0 rgba(255, 255, 255, 0.1);
	}

	.mphb-gs-shell[data-theme="auto"] .gs-stay-countdown--departure {
		background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #ef4444 100%);
		box-shadow:
			0 4px 24px rgba(239, 68, 68, 0.4),
			0 0 0 1px rgba(248, 113, 113, 0.3),
			inset 0 1px 0 rgba(255, 255, 255, 0.1);
	}

	.mphb-gs-shell[data-theme="auto"] .gs-stay-countdown--safe_travels {
		background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #ef4444 100%);
		box-shadow:
			0 4px 40px rgba(239, 68, 68, 0.6),
			0 0 80px rgba(248, 113, 113, 0.4),
			inset 0 1px 0 rgba(255, 255, 255, 0.1);
	}
}

/* Fade out animation for messages */
.gs-stay-countdown--fading {
	animation: gs-countdown-fade-out 1s ease-out forwards;
}

@keyframes gs-countdown-fade-out {
	from {
		opacity: 1;
		transform: translateY(0);
	}
	to {
		opacity: 0;
		transform: translateY(-10px);
	}
}

/* ========================================
 * Summary Hero: badge beside the title
 * ======================================== */

.gs-summary-hero {
	height: auto;
	min-height: 100px;
	column-gap: var(--gs-space-sm, 8px);
}

.gs-summary-hero .gs-hero-badge {
	position: static;
	order: 2;
	align-self: flex-start;
	flex-shrink: 0;
	max-width: 50%;
}

.gs-summary-hero .gs-hero-content {
	flex: 1 1 0;
	min-width: 0;
	align-self: flex-end;
}

.gs-summary-hero .gs-hero-title {
	overflow-wrap: anywhere;
}
