/* =====================================================================
   Countdown Widget Builder — app.css
   Extends the shared design system (base.css). The .cdw-* classes here
   mirror exactly what the generated embeddable snippet inlines, so the
   live preview matches the exported widget pixel-for-pixel.
   ===================================================================== */

[data-theme="light"] .icon-sun { display: none; }
.icon-moon { display: none; }

.pane-title { margin: 0 0 var(--space-4); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); }

/* ===================== Layout ===================== */
.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--space-6);
  align-items: start;
  margin-top: var(--space-2);
}
.form-panel { display: flex; flex-direction: column; gap: var(--space-4); position: sticky; top: calc(64px + var(--space-4)); }
.preview-panel, .snippet-panel { min-width: 0; }

/* ===================== Status badge ===================== */
#statusBadge .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--info); flex: none; box-shadow: 0 0 10px var(--info); }
#statusBadge.is-expired { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
#statusBadge.is-expired .status-dot { background: var(--warning); box-shadow: 0 0 10px var(--warning); }

/* ===================== Snippet output ===================== */
.output-scroll { position: relative; max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-solid); }
.output-code { margin: 0; padding: var(--space-4); font-size: 12.5px; line-height: 1.6; white-space: pre; color: var(--text-secondary); }

/* ===================== Countdown widget preview ===================== */
.countdown-mount { display: flex; justify-content: center; padding: var(--space-6) var(--space-2); }

.cdw-widget {
  --cdw-accent: #6366f1;
  --cdw-bg: #12131c;
  --cdw-fg: #f4f5fa;
  --cdw-sub: #9599ad;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: 28px 32px;
  border-radius: 20px;
  background: var(--cdw-bg);
  color: var(--cdw-fg);
  font-family: var(--font-sans);
  text-align: center;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.5);
  max-width: 100%;
}
.cdw-label { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.cdw-units { display: flex; align-items: stretch; gap: 14px; flex-wrap: wrap; justify-content: center; }
.cdw-unit { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 64px; }
.cdw-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  padding: 12px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  min-width: 56px;
}
.cdw-unit-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--cdw-sub); }
.cdw-expired { font-size: 20px; font-weight: 700; background: linear-gradient(135deg, var(--cdw-accent), #d946ef); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }

/* Sizes */
.cdw-size-sm .cdw-num { font-size: 22px; min-width: 44px; padding: 8px 6px; }
.cdw-size-md .cdw-num { font-size: 34px; }
.cdw-size-lg .cdw-num { font-size: 48px; padding: 16px 14px; min-width: 72px; }

/* Themes */
.cdw-theme-aurora { --cdw-bg: linear-gradient(135deg, #1a1c2e, #241a35); }
.cdw-theme-aurora .cdw-num { background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(217,70,239,.18)); border-color: rgba(255,255,255,.12); }
.cdw-theme-aurora .cdw-num { color: #fff; }

.cdw-theme-midnight { --cdw-bg: #0a0b10; }
.cdw-theme-midnight .cdw-num { background: rgba(255,255,255,.04); }

.cdw-theme-sunset { --cdw-bg: linear-gradient(135deg, #2b1220, #3a1a12); }
.cdw-theme-sunset .cdw-num { background: linear-gradient(135deg, rgba(249,115,22,.22), rgba(236,72,153,.18)); }

.cdw-theme-mint { --cdw-bg: linear-gradient(135deg, #0c231c, #0a1e2b); }
.cdw-theme-mint .cdw-num { background: linear-gradient(135deg, rgba(34,197,94,.2), rgba(34,211,238,.16)); }

.cdw-theme-mono { --cdw-bg: #16171e; --cdw-sub: #7c7f90; }
.cdw-theme-mono .cdw-num { background: rgba(255,255,255,.05); }

/* Accent color applies to the label + expired message via CSS var */
.cdw-widget .cdw-label { color: var(--cdw-accent); }

/* ===================== Responsive ===================== */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .form-panel { position: static; }
}
@media (max-width: 460px) {
  .cdw-widget { padding: 20px 16px; }
  .cdw-unit { min-width: 52px; }
}
