/**
 * Celestial Dashboard - Seasonal Particle Animations CSS
 * Keyframe animations for winter, spring, summer, and fall particles
 */

/* =================================================================
   PARTICLE CONTAINER
   ================================================================= */

.ucd-clock-wrapper {
    position: relative; /* Ensure particles are positioned relative to clock */
}

.ucd-particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Don't interfere with clock interactions */
    overflow: hidden; /* Keep particles inside clock bounds */
    z-index: 5; /* Above clock, below legend */
    border-radius: 50%; /* Match clock's circular shape */
}

/* =================================================================
   BASE PARTICLE STYLES
   ================================================================= */

.ucd-particle {
    position: absolute;
    pointer-events: none;
    will-change: transform, opacity;
}

.ucd-particle svg {
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* =================================================================
   WINTER - SNOWFLAKES FALLING
   Animation: Fall from top with gentle sway
   ================================================================= */

.ucd-particle-winter {
    animation: snowfall var(--duration, 10s) linear infinite;
    --rotation-offset: 0deg;
}

@keyframes snowfall {
    0% {transform: translateY(0) translateX(0) rotate(var(--rotation-offset));                          opacity: 0;}
    10% {                                                                                               opacity: 0.8;}
    50% {                                                                                               opacity: 0;}
    75% {                                                                                               opacity: 0;}
    90% {                                                                                               opacity: 0;}
    100% {transform: translateY(550px) translateX(30px) rotate(calc(var(--rotation-offset) + 180deg));  opacity: 0;}
}

/* Alternate sway pattern for variety */
.ucd-particle-winter:nth-child(2n) {
    animation: snowfall-alt var(--duration, 10s) linear infinite;
}

@keyframes snowfall-alt {
    0% {transform: translateY(0) translateX(0) rotate(var(--rotation-offset));                          opacity: 0;}
    10% {                                                                                               opacity: 0.8;}
    25% {transform: translateY(137px) translateX(-15px) rotate(calc(var(--rotation-offset) + 45deg));   opacity: 0;}
    50% {transform: translateY(275px) translateX(10px) rotate(calc(var(--rotation-offset) + 90deg));    opacity: 0;}
    75% {transform: translateY(412px) translateX(-20px) rotate(calc(var(--rotation-offset) + 135deg));  opacity: 0;}
    90% {                                                                                               opacity: 0;}
    100% {transform: translateY(550px) translateX(-30px) rotate(calc(var(--rotation-offset) + 180deg)); opacity: 0;}
}

/* =================================================================
   SPRING - FLOWER PETALS DRIFTING
   Animation: Float from right with arc motion
   ================================================================= */

.ucd-particle-spring {
    animation: petal-drift var(--duration, 12s) linear infinite;
    --drift-amount: 50px;
}

@keyframes petal-drift {
    0% {transform: translateX(0) translateY(0) rotate(0deg);                            opacity: 0.0;  }
    10%  {                                                                              opacity: 0.9;}
    25%  {transform: translateX(-100px) translateY(-30px) rotate(90deg);                             }
    50%  {transform: translateX(-250px) translateY(var(--drift-amount)) rotate(180deg); opacity: 0.0;}
    75%  {transform: translateX(-400px) translateY(-20px) rotate(270deg);               opacity: 0.0;  }
    100% {transform: translateX(-550px) translateY(30px) rotate(360deg);                  }
}

/* Alternate drift pattern */
.ucd-particle-spring:nth-child(3n) {
    animation: petal-drift-alt var(--duration, 12s) linear infinite;
}

@keyframes petal-drift-alt {
    0%   {transform: translateX(0) translateY(0) rotate(0deg);              opacity: 0.0;  }
    10%  {                                                                  opacity: 0.9;}
    30%  {transform: translateX(-150px) translateY(40px) rotate(120deg);                 }
    60%  {transform: translateX(-300px) translateY(-30px) rotate(240deg);   opacity: 0.0;  }
    100% {transform: translateX(-550px) translateY(20px) rotate(360deg);      }
}

/* =================================================================
   SUMMER - HEAT RAYS RISING
   Animation: Rise from bottom with shimmer/wave
   ================================================================= */

.ucd-particle-summer {
    animation: heat-rise var(--duration, 8s) linear infinite;
    --wave-intensity: 8px;
}

@keyframes heat-rise {
    0%   {transform: translateY(0)      translateX(0)                                scale(1);     opacity: 0;}
    25%  {transform: translateY(-137px) translateX(     var(--wave-intensity))       scale(1.1);   opacity: 0.9;}
    50%  {transform: translateY(-275px) translateX(calc(var(--wave-intensity) * -1)) scale(1.05);  opacity: 0.6;}
    75%  {transform: translateY(-412px) translateX(     var(--wave-intensity))       scale(0.95);  opacity: 0;}
    100% {transform: translateY(-550px) translateX(0)                                scale(0.8);   opacity: 0;}
}

/* Shimmer variant */
.ucd-particle-summer:nth-child(2n) {
    animation: heat-shimmer var(--duration, 32s) linear infinite;
}

@keyframes heat-shimmer {
    0%   {transform: translateY(0)      translateX(0)    scale(1)    skewX(0deg);  opacity: 0;}
    20%  {transform: translateY(-110px) translateX(-5px) scale(1.05) skewX(3deg);  opacity: 0.9;}
    40%  {transform: translateY(-220px) translateX(8px)  scale(1.1)  skewX(-2deg); opacity: 0.6;}
    60%  {transform: translateY(-330px) translateX(-6px) scale(1)    skewX(2deg);  opacity: 0;}
    80%  {transform: translateY(-440px) translateX(4px)  scale(0.9)  skewX(-1deg); opacity: 0;}
    100% {transform: translateY(-550px) translateX(0)    scale(0.7)  skewX(0deg);  opacity: 0;}
}



/* =================================================================
   FALL - LEAVES TUMBLING
   Animation: Blow from left with spiraling motion
   ================================================================= */

.ucd-particle-fall {
    animation: leaf-tumble var(--duration, 9s) linear infinite;
    --tumble-amount: 360deg;
}

@keyframes leaf-tumble {
    0%   {transform: translateX(0)     translateY(0)     rotate(0deg);                              opacity: 0;  }
    10%  {                                                                                          opacity: 0.9;}
    20%  {transform: translateX(110px) translateY(30px)  rotate(calc(var(--tumble-amount) * 0.2));               }
    40%  {transform: translateX(220px) translateY(-20px) rotate(calc(var(--tumble-amount) * 0.4));               }
    60%  {transform: translateX(330px) translateY(40px)  rotate(calc(var(--tumble-amount) * 0.6));               }
    80%  {transform: translateX(440px) translateY(-10px) rotate(calc(var(--tumble-amount) * 0.8));  opacity: 0.9;}
    100% {transform: translateX(550px) translateY(25px)  rotate(     var(--tumble-amount)       );  opacity: 0;  }
}

/* Spiraling variant */
.ucd-particle-fall:nth-child(2n) {
    animation: leaf-spiral var(--duration, 9s) linear infinite;
}

@keyframes leaf-spiral {
    0% {transform: translateX(0) translateY(0) rotate(0deg) scale(1);opacity: 0;}
    10% {opacity: 0.9;}
    25% {transform: translateX(137px) translateY(-40px) rotate(180deg) scale(1.1);}
    50% {transform: translateX(275px) translateY(30px) rotate(360deg) scale(0.9);}
    75% {transform: translateX(412px) translateY(-25px) rotate(540deg) scale(1.05);}
    90% {opacity: 0.9;}
    100% {transform: translateX(550px) translateY(20px) rotate(720deg) scale(0.8);opacity: 0;}
}

/* =================================================================
   PERFORMANCE OPTIMIZATIONS
   ================================================================= */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .ucd-particle {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        opacity: 0 !important;
    }
}

/* Pause animations when tab is not visible */
.ucd-particle-container.paused .ucd-particle {
    animation-play-state: paused;
}

/* =================================================================
   HORIZON MODE TOGGLE
   Segmented control injected below the clock face when the user
   has configured a custom flat offset or terrain profile horizon.
   ================================================================= */

.ucd-horizon-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 4px 8px;
    user-select: none;
}

.ucd-horizon-toggle-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9ca3af;
}

.ucd-horizon-btn-group {
    display: flex;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    /* No overflow:hidden — it clips the active border-bottom */
}

.ucd-horizon-btn {
    all: unset;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 11px;
    color: #6b7280;                        /* dim — clearly unchosen */
    background: rgba(255, 255, 255, 0.03);
    border-right: 1px solid rgba(255, 255, 255, 0.10);
    border-bottom: 2px solid transparent;  /* reserved space — no layout shift on active */
    transition: color 0.15s ease, background 0.15s ease, border-bottom-color 0.15s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.ucd-horizon-btn:first-child {
    border-radius: 5px 0 0 5px;
}

.ucd-horizon-btn:last-child {
    border-right: none;
    border-radius: 0 5px 5px 0;
}

/* Hover on inactive: text brightens, hairline preview of accent — never looks selected */
.ucd-horizon-btn:not(.active):hover {
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.06);
    border-bottom-color: rgba(255, 255, 255, 0.18);
}

/* ── Active states — colored bottom border anchors the selection ────────────
   Stronger tint + bright text + full-opacity accent border-bottom.           */

.ucd-horizon-toggle[data-active-mode="true"] .ucd-horizon-btn.active {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-bottom-color: #ef4444;
}

.ucd-horizon-toggle[data-active-mode="flat"] .ucd-horizon-btn.active {
    background: rgba(245, 158, 11, 0.15);
    color: #fde68a;
    border-bottom-color: #f59e0b;
}

/* Profile horizon — emerald green (distinct from the cyan object path) */
.ucd-horizon-toggle[data-active-mode="profile"] .ucd-horizon-btn.active {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-bottom-color: #10b981;
}

/* Small "not-true-horizon" indicator badge on the toggle label when a
   custom horizon is active — a subtle reminder to the observer. */
.ucd-horizon-toggle[data-active-mode="flat"]    .ucd-horizon-toggle-label::after,
.ucd-horizon-toggle[data-active-mode="profile"] .ucd-horizon-toggle-label::after {
    content: " ●";
    color: currentColor;
    opacity: 0.7;
    font-size: 8px;
    vertical-align: middle;
}

/* ── Horizon-adjusted info card outline ─────────────────────────────────────
   Applied by renderInfoItem() when a non-true horizon mode is active.
   Uses !important to override any WordPress theme border resets.          */
.ucd-horizon-card {
    border-color: var(--ucd-hc) !important;
    box-shadow: 0 0 8px color-mix(in srgb, var(--ucd-hc) 25%, transparent) !important;
}

/* ── Visibility Windows card (Option C — profile horizon multi-window) ───────*/
.ucd-vis-windows-card {
    padding: 12px 14px;
}

.ucd-vis-window-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 13px;
}
.ucd-vis-window-row:first-of-type {
    border-top: none;
}

.ucd-vis-window-num {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--ucd-hc, #9ca3af);
}

.ucd-vis-window-times {
    flex: 1;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
}

.ucd-vis-window-dur {
    color: #9ca3af;
    font-size: 11px;
    white-space: nowrap;
}

.ucd-vis-total {
    font-size: 11px;
    color: var(--ucd-hc, #9ca3af);
    font-weight: 600;
}
/* ============================================================================
   GUEST NOTES PROMPT
   ============================================================================ */

.ucd-guest-notes-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 24px 24px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 41, 59, 0.7) 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ucd-guest-notes-icon {
    font-size: 2rem;
    margin-bottom: 4px;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.4));
}

.ucd-guest-notes-title {
    color: #e2e8f0;
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    letter-spacing: 0.01em;
}

.ucd-guest-notes-message {
    color: #94a3b8;
    font-size: 0.8125rem;
    line-height: 1.5;
    margin: 0 0 16px 0;
    max-width: 280px;
}

.ucd-guest-notes-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff !important;
    border-radius: 7px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    transition: all 0.2s ease;
}

.ucd-guest-notes-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    text-decoration: none !important;
}