/**
 * 2026 fancy|modules
 *
 * Countdown Timer Styles
 * @author fancy|modules <roman.sekeres@fancystudio.sk>
 * @copyright 2019-2026 fancy|modules
 * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
 */

/* Countdown Container */
.fancy-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    box-sizing: border-box;
    width: 100%;
}

.fancy-countdown.countdown-expired {
    opacity: 0.7;
}

/* Position: Overlay */
.fancy-banner-wrapper {
    position: relative;
}

.fancy-countdown.position-overlay_top,
.fancy-countdown.position-overlay_bottom {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 10;
}

.fancy-countdown.position-overlay_top {
    top: 0;
    border-radius: 0 0 4px 4px;
}

.fancy-countdown.position-overlay_bottom {
    bottom: 0;
    border-radius: 4px 4px 0 0;
}

.fancy-countdown.position-below {
    position: relative;
    border-radius: 0 0 4px 4px;
    margin-top: -4px;
}

/* Text Before/After */
.countdown-text-before,
.countdown-text-after {
    font-size: 10px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.countdown-text-after {
    margin-bottom: 0;
}

/* Timer Container */
.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 28px;
}

.countdown-separator {
    font-size: 14px;
    font-weight: bold;
    margin: 0 2px;
    opacity: 0.8;
}

/* Countdown Labels */
.countdown-label {
    font-size: 8px;
    text-transform: uppercase;
    opacity: 0.8;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

/* ======================
   FLIP STYLE
   ====================== */
.fancy-countdown.style-flip .countdown-value {
    display: block;
    background: linear-gradient(180deg,
        rgba(255,255,255,0.15) 0%,
        rgba(255,255,255,0.15) 49%,
        rgba(0,0,0,0.1) 50%,
        rgba(0,0,0,0.1) 100%
    );
    padding: 6px 4px;
    border-radius: 3px;
    font-family: 'Courier New', 'Lucida Console', monospace;
    font-weight: bold;
    font-size: 14px;
    min-width: 28px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
}

.fancy-countdown.style-flip .countdown-value::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(0,0,0,0.15);
}

/* Flip Animation */
.fancy-countdown.style-flip .countdown-value.flip-animate {
    animation: flipDown 0.6s ease-in-out;
}

@keyframes flipDown {
    0% {
        transform: perspective(100px) rotateX(0deg);
    }
    50% {
        transform: perspective(100px) rotateX(-5deg);
    }
    100% {
        transform: perspective(100px) rotateX(0deg);
    }
}

/* ======================
   SIMPLE STYLE
   ====================== */
.fancy-countdown.style-simple .countdown-timer {
    gap: 0;
}

.fancy-countdown.style-simple .countdown-value {
    font-family: 'Courier New', 'Lucida Console', monospace;
    font-weight: bold;
    font-size: 16px;
    padding: 0 2px;
}

.fancy-countdown.style-simple .countdown-separator {
    font-size: 16px;
}

.fancy-countdown.style-simple .countdown-label {
    display: none;
}

.fancy-countdown.style-simple .countdown-item {
    flex-direction: row;
    min-width: auto;
}

/* ======================
   MOBILE BANNER COUNTDOWN
   ====================== */
#mobile-ad-banner-wrapper .fancy-countdown {
    padding: 6px 10px;
}

#mobile-ad-banner-wrapper .fancy-countdown .countdown-timer {
    flex-wrap: nowrap;
}

#mobile-ad-banner-wrapper .fancy-countdown.style-flip .countdown-value {
    font-size: 12px;
    padding: 4px 3px;
    min-width: 24px;
}

#mobile-ad-banner-wrapper .fancy-countdown .countdown-text-before,
#mobile-ad-banner-wrapper .fancy-countdown .countdown-text-after {
    font-size: 9px;
    margin-bottom: 4px;
}

#mobile-ad-banner-wrapper .fancy-countdown .countdown-label {
    font-size: 7px;
}

/* ======================
   SIDE BANNER COUNTDOWN (Vertical)
   ====================== */
.fancy-baner-left + .fancy-countdown,
.fancy-baner-right + .fancy-countdown,
.fancy-banner-wrapper.side-banner .fancy-countdown {
    flex-direction: column;
}

.fancy-banner-wrapper.side-banner .countdown-timer {
    flex-direction: column;
    gap: 6px;
}

.fancy-banner-wrapper.side-banner .countdown-item {
    flex-direction: column;
}

.fancy-banner-wrapper.side-banner .countdown-separator {
    display: none;
}

.fancy-banner-wrapper.side-banner.style-flip .countdown-value {
    font-size: 16px;
    min-width: 36px;
    padding: 8px 6px;
}

.fancy-banner-wrapper.side-banner .countdown-label {
    display: block;
    font-size: 9px;
}

/* ======================
   RESPONSIVE ADJUSTMENTS
   ====================== */
@media (max-width: 480px) {
    .fancy-countdown .countdown-value {
        font-size: 12px !important;
        min-width: 22px !important;
        padding: 4px 3px !important;
    }

    .fancy-countdown .countdown-text-before,
    .fancy-countdown .countdown-text-after {
        font-size: 8px;
    }

    .fancy-countdown .countdown-label {
        font-size: 7px;
    }
}

/* ======================
   URGENCY PULSE ANIMATION
   ====================== */
.fancy-countdown.countdown-urgent {
    animation: urgencyPulse 1s ease-in-out infinite;
}

@keyframes urgencyPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Only pulse when less than 1 hour remaining */
.fancy-countdown.countdown-urgent .countdown-value {
    animation: valueGlow 1s ease-in-out infinite;
}

@keyframes valueGlow {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    50% {
        box-shadow: 0 2px 8px rgba(255,100,100,0.4);
    }
}