/* =====================================================
   MODERN FLIP CLOCK – CLOCK DISPLAY THEMES
   ===================================================== */

/* --------- CYBERPUNK NEON THEME --------- */
body.theme-cyberpunk {
    --flip-bg: #0a0015;
    --flip-bg-alt: #12002a;
    --flip-text: #ff00ff;
    --flip-separator-color: #00ffff;
    --flip-glow-color: rgba(255, 0, 255, 0.5);
    --clr-accent: #ff00ff;
    --clr-accent-2: #00ffff;
}

body.theme-cyberpunk .flip-card {
    text-shadow:
        0 0 6px #ff00ff,
        0 0 14px #ff00ff,
        0 0 28px rgba(255, 0, 255, 0.7);
    border-color: rgba(255, 0, 255, 0.18) !important;
}

body.theme-cyberpunk .flip-separator .dot {
    background: #00ffff;
    box-shadow: 0 0 6px #00ffff, 0 0 14px #00ffff, 0 0 26px rgba(0, 255, 255, 0.6);
}

body.theme-cyberpunk .flip-clock-wrapper {
    filter: drop-shadow(0 0 30px rgba(255, 0, 255, 0.5));
}

/* --------- HACKER MODE --------- */
body.theme-hacker {
    --flip-bg: #000;
    --flip-bg-alt: #001400;
    --flip-text: #00ff41;
    --flip-separator-color: #00ff41;
    --flip-glow-color: rgba(0, 255, 65, 0.45);
    --clr-accent: #00ff41;
    --clr-bg-primary: #000;
    --clr-bg-secondary: #000;
    --clr-accent-2: #00cc33;
}

body.theme-hacker .flip-card {
    font-family: var(--font-mono) !important;
    text-shadow: 0 0 8px #00ff41, 0 0 16px rgba(0, 255, 65, 0.6);
    border-color: rgba(0, 255, 65, 0.15) !important;
}

body.theme-hacker .flip-clock-wrapper {
    filter: drop-shadow(0 0 20px rgba(0, 255, 65, 0.5));
}

body.theme-hacker .bg-gradient-overlay {
    background: radial-gradient(ellipse at 50% 60%, rgba(0, 255, 65, 0.08) 0%, transparent 60%);
}

/* --------- GLASS MORPHISM (Apple) --------- */
body.theme-glass {
    --flip-bg: rgba(255, 255, 255, 0.12);
    --flip-bg-alt: rgba(255, 255, 255, 0.08);
    --flip-text: #ffffff;
    --flip-border: rgba(255, 255, 255, 0.22);
    --flip-separator-color: rgba(255, 255, 255, 0.8);
    --flip-glow-color: rgba(255, 255, 255, 0.2);
}

body.theme-glass .flip-card {
    backdrop-filter: blur(20px) saturate(1.8) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.8) !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* --------- MINIMAL CLEAN --------- */
body.theme-minimal {
    --flip-bg: transparent;
    --flip-bg-alt: transparent;
    --flip-border: rgba(255, 255, 255, 0.15);
    --flip-text: #ffffff;
    --flip-shadow: none;
}

body.theme-minimal .flip-unit {
    box-shadow: none !important;
}

body.theme-minimal .flip-unit::after {
    display: none;
}

body.theme-minimal .flip-card.upper {
    border-radius: 0 !important;
}

body.theme-minimal .flip-card.lower {
    border-radius: 0 !important;
}

/* --------- RETRO ORANGE --------- */
body.theme-retro {
    --flip-bg: #1e0f00;
    --flip-bg-alt: #120a00;
    --flip-text: #ff9933;
    --flip-separator-color: #ff6600;
    --flip-glow-color: rgba(255, 102, 0, 0.45);
    --clr-accent: #ff9933;
    --clr-accent-2: #ff6600;
    --clr-bg-primary: #0a0500;
    --clr-bg-secondary: #0f0700;
}

body.theme-retro .flip-card {
    font-family: 'Courier New', monospace !important;
    text-shadow: 0 0 6px rgba(255, 153, 51, 0.6);
}

/* --------- MIDNIGHT BLUE --------- */
body.theme-midnight {
    --flip-bg: #050a1a;
    --flip-bg-alt: #0a1230;
    --flip-text: #7eb8f7;
    --flip-separator-color: #4a90e2;
    --flip-glow-color: rgba(74, 144, 226, 0.45);
    --clr-accent: #4a90e2;
    --clr-bg-primary: #02050f;
}

/* --------- SUNSET WARM --------- */
body.theme-sunset {
    --flip-bg: #1a0520;
    --flip-bg-alt: #250830;
    --flip-text: #ff8c69;
    --flip-separator-color: #ff6347;
    --flip-glow-color: rgba(255, 99, 71, 0.45);
    --clr-accent: #ff6347;
    --clr-accent-2: #ff8c69;
}

body.theme-sunset .bg-gradient-overlay {
    background:
        radial-gradient(ellipse at 30% 80%, rgba(255, 69, 0, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 20%, rgba(255, 140, 0, 0.15) 0%, transparent 50%);
}

/* --------- FOREST GREEN --------- */
body.theme-forest {
    --flip-bg: #051a0a;
    --flip-bg-alt: #082510;
    --flip-text: #5dd88a;
    --flip-separator-color: #2ecc71;
    --flip-glow-color: rgba(46, 204, 113, 0.4);
    --clr-accent: #2ecc71;
    --clr-accent-2: #27ae60;
}

/* --------- BINARY CLOCK OVERLAY --------- */
.binary-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
}

.binary-row {
    display: flex;
    gap: 0.4rem;
}

.binary-bit {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--clr-border);
    border: 1px solid var(--clr-border);
    transition: background var(--trans-fast), box-shadow var(--trans-fast);
}

.binary-bit.on {
    background: var(--clr-accent);
    box-shadow: 0 0 8px var(--clr-accent), 0 0 16px rgba(99, 102, 241, 0.4);
}

.binary-row-label {
    font-size: 0.65rem;
    color: var(--clr-text-muted);
    text-align: center;
    margin-top: 0.2rem;
}

/* --------- ROMAN NUMERAL MODE --------- */
.roman-display {
    font-family: 'Georgia', serif;
    font-size: clamp(1.5rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--flip-text);
    text-shadow: var(--flip-shadow);
}

/* --------- ANALOG + FLIP COMBO --------- */
.analog-clock-face {
    width: clamp(80px, 15vw, 140px);
    height: clamp(80px, 15vw, 140px);
    border-radius: 50%;
    background: var(--flip-bg);
    border: 2px solid var(--clr-accent);
    position: relative;
    box-shadow: 0 0 20px var(--flip-glow-color);
    margin: 0 1rem;
}

.analog-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 3px;
}

.analog-hour {
    width: 3px;
    height: 30%;
    background: var(--clr-text-primary);
    margin-left: -1.5px;
}

.analog-minute {
    width: 2px;
    height: 42%;
    background: var(--clr-accent);
    margin-left: -1px;
}

.analog-second {
    width: 1px;
    height: 45%;
    background: var(--clr-danger);
    margin-left: -0.5px;
}

.analog-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--clr-accent);
    box-shadow: 0 0 6px var(--clr-accent);
}

.analog-tick {
    position: absolute;
    top: 4px;
    left: 50%;
    width: 1px;
    height: 8px;
    background: rgba(255, 255, 255, 0.25);
    transform-origin: bottom center;
    transform: translateX(-50%);
}

.analog-tick.major {
    height: 12px;
    width: 2px;
    background: rgba(255, 255, 255, 0.55);
}

/* --------- CUSTOM EVENT COUNTDOWN --------- */
.event-countdown-display {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.event-unit {
    text-align: center;
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
}

.event-unit-value {
    font-family: var(--font-clock);
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

.event-unit-label {
    font-size: 0.7rem;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* --------- PARTICLE CANVAS --------- */
#particleCanvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* --------- DARK AUTO DIM --------- */
body.auto-dim-active {
    filter: brightness(0.65);
    transition: filter 2s ease;
}