/**
 * Frontend styles for ChronoPress Countdown Block
 *
 * @package ChronoPressCountdownBlock
 */

/* Base styles */
.wp-block-chronopress-countdown-block-countdown {
	margin: 1.5em 0;
	box-sizing: border-box;
}

.countdown-timer {
	display: flex;
	justify-content: center;
	align-items: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.countdown-timer__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: center;
	align-items: center;
}

.countdown-timer__unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.countdown-timer__value {
	font-weight: 700;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.countdown-timer__label {
	font-size: 0.875em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-top: 0.5em;
	color: #ffffff;
	opacity: 0.9;
}

/* Circle Style */
.countdown-timer--circle .countdown-timer__unit {
	position: relative;
	width: 100px;
	height: 100px;
}

.countdown-timer--circle .countdown-timer__value {
	font-size: 2rem;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: #000000;
	color: #ffffff;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.countdown-timer--circle .countdown-timer__label {
	position: absolute;
	bottom: -1.5em;
	left: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
}

/* Flip Style */
.countdown-timer--flip .countdown-timer__unit {
	perspective: 1000px;
}

.countdown-timer--flip .countdown-timer__value {
	font-size: 3rem;
	width: 80px;
	height: 100px;
	position: relative;
	background: #000000;
	color: #ffffff;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.countdown-timer--flip .countdown-timer__value::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
	pointer-events: none;
}

.countdown-timer--flip .countdown-timer__value::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	background: rgba(255, 255, 255, 0.2);
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.countdown-timer--flip .countdown-timer__label {
	margin-top: 0.75em;
	font-size: 0.75em;
}

/* Linear Style */
.countdown-timer--linear .countdown-timer__inner {
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 0.5rem;
}

.countdown-timer--linear .countdown-timer__unit {
	flex-direction: row;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	background: #000000;
	border-radius: 4px;
}

.countdown-timer--linear .countdown-timer__value {
	font-size: 1.5rem;
	color: #ffffff;
}

.countdown-timer--linear .countdown-timer__label {
	margin-top: 0;
	font-size: 0.875em;
	color: #ffffff;
	opacity: 0.9;
}

.countdown-timer--linear .countdown-timer__unit:not(:last-child)::after {
	content: ':';
	font-size: 1.5rem;
	font-weight: 700;
	color: #ffffff;
	margin-left: 0.5rem;
	opacity: 0.8;
}

/* Box Style */
.countdown-timer--box .countdown-timer__unit {
	min-width: 80px;
	padding: 1rem;
	background: #000000;
	border: 2px solid #333333;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.countdown-timer--box .countdown-timer__unit:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
	border-color: #555555;
}

.countdown-timer--box .countdown-timer__value {
	font-size: 2rem;
	color: #ffffff;
}

.countdown-timer--box .countdown-timer__label {
	margin-top: 0.5em;
	font-size: 0.75em;
	color: #ffffff;
	opacity: 0.9;
}

/* Expired state */
.countdown-timer--expired .countdown-timer__value {
	opacity: 0.5;
}

/* Responsive styles */
@media (max-width: 768px) {
	.countdown-timer--circle .countdown-timer__unit {
		width: 80px;
		height: 80px;
	}

	.countdown-timer--circle .countdown-timer__value {
		font-size: 1.5rem;
	}

	.countdown-timer--flip .countdown-timer__value {
		font-size: 2rem;
		width: 60px;
		height: 80px;
	}

	.countdown-timer--linear .countdown-timer__value {
		font-size: 1.25rem;
	}

	.countdown-timer--box .countdown-timer__unit {
		min-width: 60px;
		padding: 0.75rem;
	}

	.countdown-timer--box .countdown-timer__value {
		font-size: 1.5rem;
	}
}

@media (max-width: 480px) {
	.countdown-timer__inner {
		gap: 0.5rem;
	}

	.countdown-timer--circle .countdown-timer__unit {
		width: 60px;
		height: 60px;
	}

	.countdown-timer--circle .countdown-timer__value {
		font-size: 1.25rem;
	}

	.countdown-timer--flip .countdown-timer__value {
		font-size: 1.5rem;
		width: 50px;
		height: 60px;
	}

	.countdown-timer--linear .countdown-timer__unit {
		padding: 0.25rem 0.5rem;
	}

	.countdown-timer--linear .countdown-timer__value {
		font-size: 1rem;
	}

	.countdown-timer--box .countdown-timer__unit {
		min-width: 50px;
		padding: 0.5rem;
	}

	.countdown-timer--box .countdown-timer__value {
		font-size: 1.25rem;
	}
}

/* Accessibility */
.countdown-timer__value[aria-live] {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Print styles */
@media print {
	.countdown-timer {
		break-inside: avoid;
	}
}
