/* ── Countdown Timer Plugin Styles ── */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;700&display=swap');

/* ── CSS Custom Properties ── */
.ct-widget {
    --ct-accent:    #7c3aed;
    --ct-bg:        #0f0f0f;
    --ct-surface:   #1a1a1a;
    --ct-border:    rgba(255,255,255,0.08);
    --ct-text:      #ffffff;
    --ct-muted:     rgba(255,255,255,0.45);
    --ct-sep:       rgba(255,255,255,0.2);
    --ct-radius:    16px;
    --ct-num-size:  clamp(2.8rem, 9vw, 5.5rem);
    --ct-title-size:clamp(1.6rem, 5.5vw, 3rem);
}

/* ── Light Theme ── */
.ct-theme-light {
    --ct-bg:      #f5f5f5;
    --ct-surface: #ffffff;
    --ct-border:  rgba(0,0,0,0.09);
    --ct-text:    #111111;
    --ct-muted:   rgba(0,0,0,0.45);
    --ct-sep:     rgba(0,0,0,0.15);
}

/* ── Auto Theme: follow OS ── */
@media (prefers-color-scheme: dark) {
    .ct-theme-auto {
        --ct-bg:      #0f0f0f;
        --ct-surface: #1a1a1a;
        --ct-border:  rgba(255,255,255,0.08);
        --ct-text:    #ffffff;
        --ct-muted:   rgba(255,255,255,0.45);
        --ct-sep:     rgba(255,255,255,0.2);
    }
}
@media (prefers-color-scheme: light) {
    .ct-theme-auto {
        --ct-bg:      #f5f5f5;
        --ct-surface: #ffffff;
        --ct-border:  rgba(0,0,0,0.09);
        --ct-text:    #111111;
        --ct-muted:   rgba(0,0,0,0.45);
        --ct-sep:     rgba(0,0,0,0.15);
    }
}

/* ── Widget Shell ── */
.ct-widget {
    font-family: 'Inter', sans-serif;
    background: var(--ct-bg);
    border-radius: var(--ct-radius);
    padding: 2px;
    margin: 16px 0;
    /* Glowing border using the accent color */
    box-shadow:
        0 0 0 1px var(--ct-border),
        0 0 0 1px var(--ct-accent),
        0 8px 40px color-mix(in srgb, var(--ct-accent) 25%, transparent);
}

.ct-inner {
    background: var(--ct-bg);
    border-radius: calc(var(--ct-radius) - 2px);
    padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 40px);
    text-align: center;
}

/* ── Event Title ── */
.ct-event-title {
    font-family: 'Bebas Neue', 'Arial Black', sans-serif;
    font-size: var(--ct-title-size);
    letter-spacing: 4px;
    color: var(--ct-text);
    margin-bottom: 28px;
    line-height: 1.05;
    text-transform: uppercase;
}

/* ── Countdown Grid ── */
.ct-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ct-unit {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: 12px;
    padding: clamp(12px, 3vw, 22px) clamp(10px, 2.5vw, 20px);
    min-width: clamp(64px, 17vw, 120px);
    flex: 1 1 64px;
    max-width: 140px;
    position: relative;
    overflow: hidden;
}

/* Subtle top accent bar */
.ct-unit::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--ct-accent);
    opacity: 0.7;
}

/* ── The Number ── */
.ct-num {
    display: block;
    font-family: 'Bebas Neue', 'Arial Black', sans-serif;
    font-size: var(--ct-num-size);
    line-height: 1;
    color: var(--ct-text);
    letter-spacing: 2px;
    text-shadow:
        0 0 20px color-mix(in srgb, var(--ct-accent) 60%, transparent),
        0 0 40px color-mix(in srgb, var(--ct-accent) 30%, transparent);
    transition: transform 0.15s ease;
}

/* ── Unit Labels ── */
.ct-unit-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ct-muted);
    margin-top: 6px;
}

/* ── Separator colons ── */
.ct-sep {
    font-family: 'Bebas Neue', sans-serif;
    font-size: var(--ct-num-size);
    color: var(--ct-sep);
    line-height: 1;
    padding-bottom: 20px; /* align with number baseline, accounting for label */
    flex: 0 0 auto;
    margin: 0 2px;
}

/* ── Status message ── */
.ct-status {
    font-size: 14px;
    color: var(--ct-muted);
    min-height: 22px;
    letter-spacing: 0.5px;
}

.ct-status.ct-expired {
    color: var(--ct-accent);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
}

/* ── Flip/tick animation on second change ── */
@keyframes ct-tick {
    0%   { transform: translateY(-4px); opacity: 0.6; }
    100% { transform: translateY(0);    opacity: 1;   }
}
.ct-num.ct-ticking {
    animation: ct-tick 0.18s ease-out forwards;
}

/* ── Pulse when < 1 min ── */
@keyframes ct-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}
.ct-widget.ct-urgent .ct-unit::before {
    animation: ct-pulse 1s ease-in-out infinite;
}
.ct-widget.ct-urgent .ct-num {
    animation: ct-pulse 1s ease-in-out infinite;
}

/* ── No-date placeholder ── */
.ct-no-date {
    color: var(--ct-muted);
    font-size: 15px;
    padding: 12px 0;
}

/* ── Responsive tweaks ── */
@media (max-width: 480px) {
    .ct-sep { display: none; }
    .ct-grid { gap: 8px; }
    .ct-unit { min-width: 70px; }
}
