/**
 * Dilux One Countdown - Frontend Styles
 * Styling for countdown timers displayed on the website
 */

/* =============================================================================
   Countdown Container
   ========================================================================== */

.dilux-countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 20px 0;
}

/* =============================================================================
   Countdown Unit (Circle Container)
   ========================================================================== */

.dilux-countdown-unit {
    position: relative;
    display: inline-block;
}

.dilux-countdown-svg {
    display: block;
}

/* =============================================================================
   Countdown Content (Numbers & Labels inside circle)
   ========================================================================== */

.dilux-countdown-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    width: 80%;
}

.dilux-countdown-number {
    font-size: 2.5em;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 5px;
}

.dilux-countdown-label {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* =============================================================================
   Progress Circle Animations
   ========================================================================== */

.dilux-countdown-progress {
    transition: stroke-dashoffset 0.3s ease-in-out;
}

/* =============================================================================
   Expired State
   ========================================================================== */

.dilux-countdown-expired,
.dilux-countdown-expired-state {
    opacity: 0.6;
}

.dilux-countdown-expired {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.2em;
    color: #666;
}

/* Expired countdown wrapper */
.dilux-countdown-expired-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    width: 100%;
}

/* Blur effect when enabled (with message) */
.dilux-expired-blur .dilux-countdown-expired-background {
    filter: blur(2px) opacity(0.3);
    pointer-events: none;
}

/* Blur effect when enabled (without message) */
.dilux-expired-blur > .dilux-countdown {
    filter: blur(2px) opacity(0.3);
}

.dilux-countdown-expired-background {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.dilux-countdown-expired-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    z-index: 10;
    max-width: 90%;
}

/* =============================================================================
   Responsive Design - Mobile
   ========================================================================== */

@media (max-width: 768px) {
    .dilux-countdown {
        flex-direction: column;
        gap: 15px;
    }

    .dilux-countdown-number {
        font-size: 2em;
    }

    .dilux-countdown-label {
        font-size: 0.75em;
    }
}

@media (max-width: 480px) {
    .dilux-countdown-number {
        font-size: 1.8em;
    }

    .dilux-countdown-label {
        font-size: 0.7em;
    }
}

/* =============================================================================
   Error Display (for admins only)
   ========================================================================== */

.dilux-countdown-error {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    margin: 20px 0;
    color: #856404;
    font-weight: 500;
}

/* =============================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .dilux-countdown-progress {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dilux-countdown-unit {
        border: 2px solid currentColor;
        border-radius: 50%;
    }
}

/* =============================================================================
   Expiry Animations
   ========================================================================== */

/* Animation: Celebration (Canvas Confetti) */
/* Celebration animations are rendered using canvas-confetti.js library */
/* No CSS needed - effects are rendered dynamically via JavaScript */
.dilux-animation-celebration {
    position: relative;
    overflow: visible;
}

/* Animation: Warning (Pulsing Icons) */
.dilux-animation-warning {
    position: relative;
}

.dilux-warning-icon {
    position: absolute;
    font-size: 3em;
    color: #ff6b6b;
    animation: warning-pulse 1.5s ease-in-out infinite;
    z-index: 100;
}

@keyframes warning-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Animation: Elegant (Soft Fade) */
.dilux-animation-elegant {
    position: relative;
}

.dilux-elegant-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.05) 100%);
    animation: elegant-fade 2s ease-in-out infinite alternate;
    z-index: 5;
    pointer-events: none;
}

@keyframes elegant-fade {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.8;
    }
}
