/**
 * Editor styles for ChronoPress Countdown Block
 *
 * @package ChronoPressCountdownBlock
 */

/* Import frontend styles */
@import url('../countdown/style.css');

/* Flip animation styles for editor (same as frontend) */
.countdown-timer--flip .countdown-timer__value {
	position: relative;
	transform-style: preserve-3d;
	perspective: 1000px;
	overflow: hidden;
}

/* Page flip animation when value changes */
.countdown-timer--flip .countdown-timer__value.page-flip {
	animation: pageFlip 0.6s ease-in-out;
}

@keyframes pageFlip {
	0% {
		transform: rotateX(0deg);
		opacity: 1;
	}
	50% {
		transform: rotateX(-90deg);
		opacity: 0.3;
	}
	51% {
		transform: rotateX(90deg);
		opacity: 0.3;
	}
	100% {
		transform: rotateX(0deg);
		opacity: 1;
	}
}

/* Add depth effect during flip */
.countdown-timer--flip .countdown-timer__value.page-flip::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%);
	opacity: 0;
	animation: flipShine 0.6s ease-in-out;
	pointer-events: none;
	z-index: 1;
}

@keyframes flipShine {
	0% {
		opacity: 0;
	}
	25% {
		opacity: 0.5;
	}
	50% {
		opacity: 0.8;
	}
	75% {
		opacity: 0.5;
	}
	100% {
		opacity: 0;
	}
}

/* Shadow effect during flip for depth */
.countdown-timer--flip .countdown-timer__value.page-flip {
	box-shadow: 0 0 30px rgba(255, 255, 255, 0.4), 
	            0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Smooth transitions for non-animating state */
.countdown-timer--flip .countdown-timer__value:not(.page-flip) {
	transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* Editor-specific adjustments */
.wp-block-chronopress-countdown-block-countdown {
	margin: 1.5em 0;
}

.countdown-timer__empty {
	padding: 2rem;
	text-align: center;
	background: #000000;
	border: 2px dashed #555555;
	border-radius: 4px;
	color: #ffffff;
	font-style: italic;
	opacity: 0.8;
}

/* Ensure preview matches frontend exactly */
.block-editor-block-preview__container .countdown-timer {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Override any editor-specific styles to match frontend */
.block-editor-block-list__block .countdown-timer__value {
	color: #ffffff !important;
}

.block-editor-block-list__block .countdown-timer__label {
	color: #ffffff !important;
}

/* Circle style in editor */
.block-editor-block-list__block .countdown-timer--circle .countdown-timer__value {
	background: #000000 !important;
	color: #ffffff !important;
}

/* Flip style in editor */
.block-editor-block-list__block .countdown-timer--flip .countdown-timer__value {
	background: #000000 !important;
	color: #ffffff !important;
}

/* Linear style in editor */
.block-editor-block-list__block .countdown-timer--linear .countdown-timer__unit {
	background: #000000 !important;
}

.block-editor-block-list__block .countdown-timer--linear .countdown-timer__value {
	color: #ffffff !important;
}

.block-editor-block-list__block .countdown-timer--linear .countdown-timer__label {
	color: #ffffff !important;
}

.block-editor-block-list__block .countdown-timer--linear .countdown-timer__unit:not(:last-child)::after {
	color: #ffffff !important;
}

/* Box style in editor */
.block-editor-block-list__block .countdown-timer--box .countdown-timer__unit {
	background: #000000 !important;
	border-color: #333333 !important;
}

.block-editor-block-list__block .countdown-timer--box .countdown-timer__value {
	color: #ffffff !important;
}

.block-editor-block-list__block .countdown-timer--box .countdown-timer__label {
	color: #ffffff !important;
}

/* Date control styling */
.countdown-timer-date-control {
	margin-bottom: 1rem;
}

.countdown-timer-date-control label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 600;
}

.countdown-timer-date-control input[type="datetime-local"] {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #8c8f94;
	border-radius: 2px;
	font-size: 14px;
	line-height: 1.5;
}
