/* ═══════════════════════════════════════════
   CLOCK FX — Dock Icon
   ═══════════════════════════════════════════ */

#module-clock-fx .ckx-btn-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
}

/* ─── outer glow field ─── */
#module-clock-fx .ckx-btn-glow {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(80, 200, 255, 0.18) 0%,
    rgba(100, 80, 255, 0.06) 55%,
    transparent 72%);
  animation: ckx-glow-breathe 3.2s ease-in-out infinite;
  z-index: 0;
}
@keyframes ckx-glow-breathe {
  0%, 100% { transform: scale(1.0); opacity: 0.6; }
  50%      { transform: scale(1.14); opacity: 1.0; }
}

/* ─── outer orbit ring (hour) ─── */
#module-clock-fx .ckx-btn-ring-outer {
  position: absolute;
  width: 34px;
  height: 20px;  /* compressed to simulate orbital tilt */
  border-radius: 50%;
  border: 1px solid rgba(160, 100, 255, 0.30);
  z-index: 1;
  animation: ckx-ring-shimmer 4s ease-in-out infinite;
}

/* ─── inner orbit ring (minute) ─── */
#module-clock-fx .ckx-btn-ring-inner {
  position: absolute;
  width: 22px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(68, 255, 170, 0.28);
  z-index: 1;
  animation: ckx-ring-shimmer 4s ease-in-out 1s infinite;
}

@keyframes ckx-ring-shimmer {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1.0;  }
}

/* ─── orbiting arms (rotate parent, dot stays upright) ─── */
#module-clock-fx .ckx-btn-arm {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 4;
}
#module-clock-fx .ckx-btn-arm-sec {
  animation: ckx-arm-rotate-sec 4s linear infinite;
}
#module-clock-fx .ckx-btn-arm-min {
  animation: ckx-arm-rotate-min 24s linear infinite;
}

@keyframes ckx-arm-rotate-sec {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes ckx-arm-rotate-min {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── orbiting dots ─── */
#module-clock-fx .ckx-btn-dot {
  position: absolute;
  border-radius: 50%;
  /* offset upward from arm origin so it orbits the center */
  transform: translateY(-11px);
}
#module-clock-fx .ckx-btn-dot-sec {
  width:  4px;
  height: 4px;
  background: #44eeff;
  box-shadow: 0 0 5px 2px rgba(68, 238, 255, 0.75);
  /* subtract half-width to keep centred on the radius */
  margin-left: -2px;
}
#module-clock-fx .ckx-btn-dot-min {
  width:  5px;
  height: 5px;
  background: #44ffaa;
  box-shadow: 0 0 5px 2px rgba(68, 255, 170, 0.60);
  margin-left: -2.5px;
  transform: translateY(-7px);  /* shorter orbit radius */
}

/* ─── centre planet ─── */
#module-clock-fx .ckx-btn-planet {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%,
    #b8dcff 0%, #4488cc 50%, #1a3058 100%);
  box-shadow:
    0 0 5px 2px rgba(80, 160, 255, 0.45),
    0 0 12px 3px rgba(60, 100, 220, 0.20);
  animation: ckx-planet-pulse 3.2s ease-in-out infinite;
  z-index: 3;
}
#module-clock-fx .ckx-btn-planet::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 4px; height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.40);
  filter: blur(1px);
}
@keyframes ckx-planet-pulse {
  0%, 100% { transform: scale(1.0); }
  50%      { transform: scale(1.07); }
}

/* ─── active / hover states ─── */
#module-clock-fx.is-active .ckx-btn-glow {
  opacity: 1;
  transform: scale(1.18);
}
#module-clock-fx.is-active .ckx-btn-arm-sec {
  animation-duration: 2s;
}
#module-clock-fx.is-active .ckx-btn-ring-outer,
#module-clock-fx.is-active .ckx-btn-ring-inner {
  opacity: 1;
}
#module-clock-fx:hover .ckx-btn-planet {
  filter: brightness(1.20);
}


/* ═══════════════════════════════════════════
   CLOCK FX — Panel
   ═══════════════════════════════════════════ */
.ckx-panel {
  position: fixed;
  right:  90px;
  top:    80px;
  width:  272px;
  max-height: calc(100vh - 100px);
  background: rgba(14, 16, 28, 0.94);
  border: 1px solid rgba(80, 200, 255, 0.14);
  border-radius: 14px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.55),
    0 0 1px rgba(80, 200, 255, 0.18);
  z-index: 920;
  display: none;
  flex-direction: column;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-family: "Inter", system-ui, sans-serif;
  color: #c8c8d0;
}
.ckx-panel--open { display: flex; }

.ckx-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(80, 200, 255, 0.08);
  cursor: grab;
  user-select: none;
}
.ckx-panel-header:active { cursor: grabbing; }
.ckx-panel-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #80e0ff;
  margin: 0;
}
.ckx-panel-header button {
  background: none;
  border: none;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.ckx-panel-header button:hover { color: #fff; }

.ckx-panel-body {
  padding: 10px 14px 14px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Legacy div usage (v1/v2); also applies to summary.ckx-section-title in v3 */
.ckx-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #60d0ff;
  margin: 10px 0 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(80, 200, 255, 0.06);
}
.ckx-section-title:first-of-type {
  margin-top: 6px;
  padding-top: 0;
  border-top: none;
}

/* v3: when .ckx-section-title is a <summary> inside <details class="ckx-section"> */
details.ckx-section > summary.ckx-section-title {
  margin: 0;
  padding: 9px 0 5px;
  border-top: none;       /* border handled by .ckx-section itself */
  cursor: pointer;
  user-select: none;
  outline: none;
  list-style: none;
}

.ckx-reset {
  margin-top: 12px;
  padding: 7px 0;
  border-radius: 8px;
  border: 1px solid rgba(80, 200, 255, 0.12);
  background: rgba(80, 200, 255, 0.04);
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ckx-reset:hover {
  background: rgba(80, 200, 255, 0.12);
  color: #80e0ff;
}

/* shared editor-field overrides */
.ckx-panel .editor-field {
  font-size: 12px;
  gap: 6px;
}
.ckx-panel .editor-field span:first-child {
  min-width: 80px;
  color: #aaa;
}
.ckx-panel input[type="range"] {
  flex: 1;
  accent-color: #40d0ff;
}
.ckx-panel input[type="color"] {
  width: 32px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  background: none;
  cursor: pointer;
}
.ckx-panel select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #ddd;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
}
.ckx-panel-body::-webkit-scrollbar { width: 5px; }
.ckx-panel-body::-webkit-scrollbar-track { background: transparent; }
.ckx-panel-body::-webkit-scrollbar-thumb {
  background: rgba(80,200,255,0.15);
  border-radius: 3px;
}


/* ═══════════════════════════════════════════
   CLOCK FX — Digital overlay
   ═══════════════════════════════════════════ */
.ckx-digital {
  position: fixed;
  z-index: 700;
  display: none;           /* shown via JS when enabled */
  align-items: baseline;
  gap: 2px;
  pointer-events: none;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 22px;
  font-weight: 500;
  color: rgba(80, 220, 255, 0.92);
  text-shadow:
    0 0 10px rgba(60, 180, 255, 0.50),
    0 0 22px rgba(60, 140, 255, 0.25);
  padding: 8px 14px;
  background: rgba(6, 10, 22, 0.62);
  border: 1px solid rgba(80, 180, 255, 0.14);
  border-radius: 9px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  letter-spacing: 0.04em;
}
.ckx-digital[data-position="top-right"]    { top: 24px;    right: 98px; }
.ckx-digital[data-position="top-left"]     { top: 24px;    left:  20px; }
.ckx-digital[data-position="bottom-right"] { bottom: 24px; right: 98px; }
.ckx-digital[data-position="bottom-left"]  { bottom: 24px; left:  20px; }

.ckx-d-sep {
  opacity: 0.55;
  animation: ckx-sep-blink 1s step-end infinite;
}
@keyframes ckx-sep-blink {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.15; }
}
.ckx-d-ms {
  font-size: 0.68em;
  opacity: 0.65;
  letter-spacing: 0;
  margin-left: 1px;
}


/* ═══════════════════════════════════════════
   CLOCK FX — Analog overlay
   ═══════════════════════════════════════════ */
.ckx-analog {
  position: fixed;
  z-index: 700;
  display: none;           /* shown via JS when enabled */
  pointer-events: none;
  border-radius: 50%;
}
.ckx-analog[data-position="top-right"]    { top: 24px;    right: 98px; }
.ckx-analog[data-position="top-left"]     { top: 24px;    left:  20px; }
.ckx-analog[data-position="bottom-right"] { bottom: 24px; right: 98px; }
.ckx-analog[data-position="bottom-left"]  { bottom: 24px; left:  20px; }


/* ═══════════════════════════════════════════
   CLOCK FX — Preset buttons grid
   ═══════════════════════════════════════════ */
.ckx-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 4px;
}

.ckx-preset-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(80, 200, 255, 0.10);
  border-radius: 8px;
  color: #aaa;
  font-size: 11px;
  font-family: "Inter", system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.3;
  white-space: nowrap;
}
.ckx-preset-btn:hover {
  background: rgba(80, 200, 255, 0.10);
  border-color: rgba(80, 200, 255, 0.28);
  color: #ddd;
}
.ckx-preset-btn.is-active {
  background: rgba(80, 200, 255, 0.14);
  border-color: rgba(80, 200, 255, 0.50);
  color: #80e0ff;
  box-shadow: 0 0 8px rgba(80, 200, 255, 0.15);
}


/* ═══════════════════════════════════════════
   CLOCK FX — Collapsible sections
   ═══════════════════════════════════════════ */
.ckx-section {
  border-top: 1px solid rgba(80, 200, 255, 0.06);
  margin-top: 2px;
}
.ckx-section:first-of-type {
  border-top: none;
}

details.ckx-section > summary.ckx-section-title::-webkit-details-marker { display: none; }
details.ckx-section > summary.ckx-section-title {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* chevron */
details.ckx-section > summary.ckx-section-title::after {
  content: "›";
  margin-left: auto;
  font-size: 14px;
  font-weight: 400;
  color: rgba(80, 200, 255, 0.45);
  transform: rotate(90deg);
  transition: transform 0.2s ease;
  line-height: 1;
}
details.ckx-section[open] > summary.ckx-section-title::after {
  transform: rotate(270deg);
}
details.ckx-section > summary.ckx-section-title:hover {
  color: #90e8ff;
}
details.ckx-section > summary.ckx-section-title:hover::after {
  color: rgba(80, 200, 255, 0.75);
}

.ckx-section-body {
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}


/* ═══════════════════════════════════════════
   CLOCK FX — Screensaver transitions
   ═══════════════════════════════════════════ */
body.ckx-ss .ckx-panel {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}
body.ckx-ss .ckx-digital {
  opacity: 0.35;
  transition: opacity 2s ease;
}
body.ckx-ss .ckx-analog {
  opacity: 0.30;
  transition: opacity 2s ease;
}
/* restore when screensaver exits */
body:not(.ckx-ss) .ckx-panel {
  transition: opacity 0.4s ease;
}
body:not(.ckx-ss) .ckx-digital,
body:not(.ckx-ss) .ckx-analog {
  transition: opacity 0.4s ease;
}
