/**
 * Vivre Impro - Countdown Timer Styles
 * 4 styles: minimal, circles, flip, progress
 * 2 modes: hero (landing page) et topbar (barre compacte)
 */

/* ========================================
   VARIABLES CSS (personnalisables)
   ======================================== */
.vivre-countdown {
    --primary-color: #E6432F;
    --secondary-color: #333333;
    --bg-color: #FFF8F0;
    --text-color: #333333;
    --accent-color: #FFA500;
}

/* ========================================
   BASE COMMUNE
   ======================================== */
.vivre-countdown {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    box-sizing: border-box;
}

.vivre-countdown * {
    box-sizing: border-box;
}

/* ========================================
   MODE HERO (Landing Page)
   ======================================== */
.vivre-countdown.mode-hero {
    padding: 40px 20px;
    text-align: center;
}

.vivre-countdown.mode-hero .countdown-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.vivre-countdown.mode-hero .countdown-boxes {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.vivre-countdown.mode-hero .countdown-expired {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    padding: 40px;
}

/* ========================================
   MODE TOPBAR (Barre compacte)
   ======================================== */
.vivre-countdown.mode-topbar {
    background: var(--bg-color);
    padding: 12px 20px;
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
}

.vivre-countdown.mode-topbar .countdown-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.vivre-countdown.mode-topbar .countdown-boxes {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

.vivre-countdown.mode-topbar .countdown-expired {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    padding: 10px;
}

/* ========================================
   MODE TOPBAR-CTA (Titre gauche, timer centre, bouton droite)
   ======================================== */
.vivre-countdown.mode-topbar-cta {
    background: var(--bg-color);
    padding: 15px 20px;
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.vivre-countdown.mode-topbar-cta .countdown-title-left {
    flex: 0 0 auto;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
}

.vivre-countdown.mode-topbar-cta .countdown-center {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
}

.vivre-countdown.mode-topbar-cta .countdown-boxes {
    display: flex;
    gap: 12px;
    align-items: center;
}

.vivre-countdown.mode-topbar-cta .countdown-cta-button {
    flex: 0 0 auto;
    background: var(--primary-color);
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.vivre-countdown.mode-topbar-cta .countdown-cta-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.vivre-countdown.mode-topbar-cta .countdown-expired {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    padding: 10px;
}

/* Responsive pour topbar-cta */
@media (max-width: 1024px) {
    .vivre-countdown.mode-topbar-cta {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 12px 15px;
    }
    
    .vivre-countdown.mode-topbar-cta .countdown-title-left {
        font-size: 14px;
    }
    
    .vivre-countdown.mode-topbar-cta .countdown-center {
        justify-content: center;
    }
    
    .vivre-countdown.mode-topbar-cta .countdown-boxes {
        gap: 10px;
    }
}

/* ========================================
   STYLE 1: MINIMAL (Boxes élégantes)
   ======================================== */
.vivre-countdown.style-minimal .countdown-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.vivre-countdown.style-minimal.mode-hero .countdown-box {
    min-width: 100px;
}

.vivre-countdown.style-minimal.mode-topbar .countdown-box {
    min-width: 50px;
}

.vivre-countdown.style-minimal .countdown-value {
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.vivre-countdown.style-minimal.mode-hero .countdown-value {
    width: 100px;
    height: 100px;
    font-size: 48px;
}

.vivre-countdown.style-minimal.mode-topbar .countdown-value {
    width: 50px;
    height: 50px;
    font-size: 24px;
    border-width: 2px;
}

.vivre-countdown.style-minimal .countdown-value:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(230, 67, 47, 0.3);
}

.vivre-countdown.style-minimal .countdown-label {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vivre-countdown.style-minimal.mode-topbar .countdown-label {
    font-size: 11px;
    margin-top: 5px;
}

/* ========================================
   STYLE 2: CIRCLES (Cercles animés)
   ======================================== */
.vivre-countdown.style-circles .countdown-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.vivre-countdown.style-circles .countdown-circle {
    position: relative;
}

.vivre-countdown.style-circles.mode-hero .countdown-circle {
    width: 120px;
    height: 120px;
}

.vivre-countdown.style-circles.mode-topbar .countdown-circle {
    width: 60px;
    height: 60px;
}

.vivre-countdown.style-circles .countdown-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.vivre-countdown.style-circles .countdown-circle-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 8;
}

.vivre-countdown.style-circles.mode-topbar .countdown-circle-bg {
    stroke-width: 6;
}

.vivre-countdown.style-circles .countdown-circle-progress {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.vivre-countdown.style-circles.mode-topbar .countdown-circle-progress {
    stroke-width: 6;
}

.vivre-countdown.style-circles .countdown-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    color: var(--text-color);
}

.vivre-countdown.style-circles.mode-hero .countdown-value {
    font-size: 36px;
}

.vivre-countdown.style-circles.mode-topbar .countdown-value {
    font-size: 18px;
}

.vivre-countdown.style-circles .countdown-label {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
}

.vivre-countdown.style-circles.mode-topbar .countdown-label {
    font-size: 10px;
    margin-top: 5px;
}

/* ========================================
   STYLE 3: FLIP (Cartes qui se retournent)
   ======================================== */
.vivre-countdown.style-flip .countdown-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.vivre-countdown.style-flip .countdown-flip-container {
    perspective: 1000px;
}

.vivre-countdown.style-flip.mode-hero .countdown-flip-container {
    width: 90px;
    height: 100px;
}

.vivre-countdown.style-flip.mode-topbar .countdown-flip-container {
    width: 45px;
    height: 50px;
}

.vivre-countdown.style-flip .countdown-flip-card {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.vivre-countdown.style-flip .countdown-flip-card.flipping {
    animation: flipAnimation 0.6s ease-in-out;
}

@keyframes flipAnimation {
    0% { transform: rotateX(0deg); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
}

.vivre-countdown.style-flip .countdown-value {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: linear-gradient(180deg, var(--primary-color) 0%, #c93626 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.vivre-countdown.style-flip.mode-hero .countdown-value {
    font-size: 48px;
}

.vivre-countdown.style-flip.mode-topbar .countdown-value {
    font-size: 24px;
    border-radius: 4px;
}

.vivre-countdown.style-flip .countdown-value::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(0, 0, 0, 0.2);
}

.vivre-countdown.style-flip .countdown-label {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
}

.vivre-countdown.style-flip.mode-topbar .countdown-label {
    font-size: 10px;
    margin-top: 5px;
}

/* ========================================
   STYLE 4: PROGRESS (Barre de progression)
   ======================================== */
.vivre-countdown.style-progress .countdown-content {
    max-width: 800px;
    margin: 0 auto;
}

.vivre-countdown.style-progress .countdown-values {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.vivre-countdown.style-progress.mode-topbar .countdown-values {
    gap: 15px;
    margin-bottom: 10px;
}

.vivre-countdown.style-progress .countdown-box {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
}

.vivre-countdown.style-progress .countdown-value {
    font-weight: 700;
    color: var(--primary-color);
}

.vivre-countdown.style-progress.mode-hero .countdown-value {
    font-size: 36px;
}

.vivre-countdown.style-progress.mode-topbar .countdown-value {
    font-size: 20px;
}

.vivre-countdown.style-progress .countdown-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: lowercase;
}

.vivre-countdown.style-progress.mode-topbar .countdown-label {
    font-size: 11px;
}

.vivre-countdown.style-progress .countdown-progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.vivre-countdown.style-progress.mode-topbar .countdown-progress-bar {
    height: 20px;
    border-radius: 10px;
}

.vivre-countdown.style-progress .countdown-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
    transition: width 1s linear;
    position: relative;
    overflow: hidden;
}

.vivre-countdown.style-progress .countdown-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.vivre-countdown.style-progress .countdown-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    color: white;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.vivre-countdown.style-progress.mode-topbar .countdown-progress-text {
    font-size: 11px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .vivre-countdown.mode-hero {
        padding: 30px 15px;
    }
    
    .vivre-countdown.mode-hero .countdown-title {
        font-size: 20px;
    }
    
    .vivre-countdown.style-minimal.mode-hero .countdown-value {
        width: 80px;
        height: 80px;
        font-size: 36px;
    }
    
    .vivre-countdown.style-circles.mode-hero .countdown-circle {
        width: 90px;
        height: 90px;
    }
    
    .vivre-countdown.style-circles.mode-hero .countdown-value {
        font-size: 28px;
    }
    
    .vivre-countdown.style-flip.mode-hero .countdown-flip-container {
        width: 70px;
        height: 80px;
    }
    
    .vivre-countdown.style-flip.mode-hero .countdown-value {
        font-size: 36px;
    }
    
    .vivre-countdown.style-progress.mode-hero .countdown-value {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .vivre-countdown.mode-hero .countdown-boxes {
        gap: 15px;
    }
    
    .vivre-countdown.style-minimal.mode-hero .countdown-value {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
    
    .vivre-countdown.style-progress .countdown-values {
        gap: 10px;
    }
}

/* ========================================
   ANIMATIONS ADDITIONNELLES
   ======================================== */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.vivre-countdown .countdown-box.pulse {
    animation: pulse 1s ease-in-out;
}

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

.vivre-countdown.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ========================================
   EXPIRED STATE
   ======================================== */
.vivre-countdown.expired {
    opacity: 0.9;
}

.vivre-countdown .countdown-expired {
    animation: fadeIn 0.6s ease-out;
}

/* ========================================
   CONFETTI ANIMATION
   ======================================== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f0f;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti:nth-child(odd) {
    animation-duration: 2.5s;
}

.confetti:nth-child(even) {
    animation-duration: 3.5s;
}
