/**
 * Frontend WPBakery Animated Countdown Styles
 *
 * Authentic Split-Flap Clock plates and Smooth Cross-Fade transitions
 */

.enym-countdown-wrap {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 20px 0;
    --enym-countdown-gap: 16px;
    --enym-countdown-bg: #1e2327;
    --enym-countdown-color: #ffffff;
    --enym-countdown-num-size: 42px;
    --enym-countdown-lbl-size: 13px;
    --enym-countdown-radius: 10px;
    --enym-card-height: calc(var(--enym-countdown-num-size, 42px) * 1.85);
}

.enym-countdown-wrap * {
    box-sizing: border-box;
}

.enym-countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--enym-countdown-gap, 16px);
    width: 100%;
    max-width: var(--enym-countdown-max-width, 100%);
    margin: 0 auto;
}

.enym-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.enym-countdown-label {
    display: block;
    margin-top: 10px;
    font-size: var(--enym-countdown-lbl-size, 13px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--enym-countdown-color, inherit);
    opacity: 0.85;
    text-align: center;
    user-select: none;
}

/* ==========================================================================
   Fade Mode (Smooth in-place crossfade)
   ========================================================================== */
.anim-fade .enym-countdown-card {
    position: relative;
    width: 100%;
    height: var(--enym-card-height, 78px);
    background-color: var(--enym-countdown-bg, #1e2327);
    color: var(--enym-countdown-color, #ffffff);
    border-radius: var(--enym-countdown-radius, 10px);
    border: var(--enym-countdown-border, 1px solid rgba(255, 255, 255, 0.08));
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.anim-fade .enym-fade-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: var(--enym-countdown-num-size, 42px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.anim-fade .enym-fade-curr {
    position: absolute;
    width: 100%;
    text-align: center;
    opacity: 1;
    transition: opacity 0.35s ease;
}

.anim-fade .enym-fade-curr.is-leaving {
    opacity: 0;
}

.anim-fade .enym-fade-next {
    position: absolute;
    width: 100%;
    text-align: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.anim-fade .enym-fade-next.is-entering {
    opacity: 1;
}

/* ==========================================================================
   Flip Mode: Authentic Split-Flap Clock (Two Separate Plates)
   ========================================================================== */
.anim-flip .enym-countdown-card {
    position: relative;
    width: 100%;
    height: var(--enym-card-height, 78px);
    background-color: var(--enym-countdown-bg, #1e2327);
    color: var(--enym-countdown-color, #ffffff);
    border-radius: var(--enym-countdown-radius, 10px);
    border: var(--enym-countdown-border, 1px solid rgba(255, 255, 255, 0.08));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16), inset 0 1px 1px rgba(255, 255, 255, 0.08);
    perspective: 500px;
    -webkit-perspective: 500px;
}

/* Top Plate */
.anim-flip .enym-flip-plate-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    overflow: hidden;
    background-color: inherit;
    color: inherit;
    border-radius: var(--enym-countdown-radius, 10px) var(--enym-countdown-radius, 10px) 0 0;
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.06));
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}

.anim-flip .enym-flip-plate-top .enym-flip-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--enym-card-height, 78px);
    line-height: var(--enym-card-height, 78px);
    text-align: center;
    font-size: var(--enym-countdown-num-size, 42px);
    font-weight: 700;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

/* Bottom Plate */
.anim-flip .enym-flip-plate-bottom {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 50%;
    overflow: hidden;
    background-color: inherit;
    color: inherit;
    border-radius: 0 0 var(--enym-countdown-radius, 10px) var(--enym-countdown-radius, 10px);
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.18));
    border-top: 1px solid rgba(0, 0, 0, 0.35);
}

.anim-flip .enym-flip-plate-bottom .enym-flip-text {
    position: absolute;
    top: calc(-0.5 * var(--enym-card-height, 78px));
    left: 0;
    width: 100%;
    height: var(--enym-card-height, 78px);
    line-height: var(--enym-card-height, 78px);
    text-align: center;
    font-size: var(--enym-countdown-num-size, 42px);
    font-weight: 700;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

/* Middle Seam Line & Notches */
.anim-flip .enym-flip-divider {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    margin-top: -1px;
    z-index: 10;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.anim-flip .enym-flip-divider::before,
.anim-flip .enym-flip-divider::after {
    content: '';
    position: absolute;
    top: -3px;
    width: 4px;
    height: 8px;
    background: rgba(0, 0, 0, 0.55);
}

.anim-flip .enym-flip-divider::before {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.anim-flip .enym-flip-divider::after {
    right: 0;
    border-radius: 3px 0 0 3px;
}

/* The Flipping Leaf (3D Fold Downward) */
.anim-flip .enym-flip-leaf {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    transform-origin: 50% 100%;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    z-index: 5;
    pointer-events: none;
    will-change: transform;
    transform: rotateX(0deg);
}

.anim-flip .enym-flip-leaf.is-flipping {
    transform: rotateX(-180deg);
    transition: transform 0.45s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

/* Leaf Front Face (Top half of old number) */
.anim-flip .enym-flip-leaf-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background-color: inherit;
    color: inherit;
    border-radius: var(--enym-countdown-radius, 10px) var(--enym-countdown-radius, 10px) 0 0;
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.06));
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}

.anim-flip .enym-flip-leaf-front .enym-flip-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--enym-card-height, 78px);
    line-height: var(--enym-card-height, 78px);
    text-align: center;
    font-size: var(--enym-countdown-num-size, 42px);
    font-weight: 700;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

/* Leaf Back Face (Bottom half of new number) */
.anim-flip .enym-flip-leaf-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: rotateX(180deg);
    background-color: inherit;
    color: inherit;
    border-radius: 0 0 var(--enym-countdown-radius, 10px) var(--enym-countdown-radius, 10px);
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.18));
    border-top: 1px solid rgba(0, 0, 0, 0.35);
}

.anim-flip .enym-flip-leaf-back .enym-flip-text {
    position: absolute;
    top: calc(-0.5 * var(--enym-card-height, 78px));
    left: 0;
    width: 100%;
    height: var(--enym-card-height, 78px);
    line-height: var(--enym-card-height, 78px);
    text-align: center;
    font-size: var(--enym-countdown-num-size, 42px);
    font-weight: 700;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Expiry Message Container
   ========================================================================== */
.enym-countdown-expiry {
    width: 100%;
    padding: 24px 20px;
    background-color: var(--enym-countdown-bg, #1e2327);
    color: var(--enym-countdown-color, #ffffff);
    border-radius: var(--enym-countdown-radius, 10px);
    border: var(--enym-countdown-border, 1px solid rgba(255, 255, 255, 0.08));
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.6;
    animation: enymCountdownFadeIn 0.5s ease-out;
}

@keyframes enymCountdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media screen and (max-width: 600px) {
    .enym-countdown-wrap {
        --enym-countdown-num-size: 32px;
        --enym-countdown-lbl-size: 11px;
        --enym-countdown-gap: 10px;
    }
}

@media screen and (max-width: 420px) {
    .enym-countdown-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .enym-countdown-wrap {
        --enym-countdown-num-size: 34px;
        --enym-countdown-lbl-size: 12px;
    }
}
