/* =====================
   DARK MODE – GLOBAL
===================== */
body.dark {
  --bg: #0f172a;
  --box: #020617;
  --text: #e5e7eb;
  --accent: #a5b4fc;
  --muted: #94a3b8;
}

body.dark{
  background:transparent;
  color:#e5e7eb;
}

/* Cards / Outputs */
body.dark .output-box{
  background:#020617;
  color:#e5e7eb;
  box-shadow:0 2px 8px rgba(0,0,0,.6);
}

/* Inputs */
body.dark textarea,
body.dark input[type="text"]{
  background:#020617;
  color:#e5e7eb;
  border:1px solid #334155;
}

/* Buttons */
body.dark button{
  background:linear-gradient(135deg,#6366f1,#22c55e);
  color:#fff;
}

body.dark .container {
  background: var(--box);
  border-color: #334155;
}

body.dark .results {
  background: #020617;
  border-color: #334155;
}

body.dark textarea {
  background: #020617;
  color: var(--text);
}

body.dark .metric-title {
  color: var(--accent);
}

body.dark h1,
body.dark h2,
body.dark h3 {
  color: var(--text);
}


/* Header */
body.dark .tool-title{
  color:#f9fafb;
}
body.dark .theme-toggle{
  color:#e5e7eb;
}
body.dark .tool-title {
color:#f9fafb;

}

/* =====================
   DARK MODE – TOOL CONTAINER
===================== */

body.dark .tool-container{
  background:#020617;
  border:1px solid #334155;
  color:#e5e7eb;
}

/* Subtitle מעל הכלי */
body.dark .subtitle{
  color:#cbd5f5;
}

/* Labels */
body.dark .tool-container label{
  color:#e5e7eb;
}

/* Inputs & Selects */
body.dark .tool-container input,
body.dark .tool-container select{
  background:#0f172a;
  color:#f9fafb;
  border:1px solid #334155;
}

body.dark .tool-container input::placeholder{
  color:#94a3b8;
}

/* Field info */
body.dark .field-info{
  color:#94a3b8;
}

/* Button */
body.dark .tool-container button{
  background:linear-gradient(135deg,#6366f1,#22c55e);
  color:#ffffff;
}

body.dark .tool-container button:hover{
  filter:brightness(1.1);
}

/* Result box */
body.dark .result-box{
  background:#020617;
  border:1px solid #334155;
  color:#e5e7eb;
}

/* Graph legend text */
body.dark .graph-legend{
  color:#cbd5f5;
}

/* Canvas wrapper */
body.dark .graph-wrap{
  background:#020617;
  border-radius:10px;
}

/* Small muted text */
body.dark #vizNote{
  color:#94a3b8;
}

/* =====================
   DARK MODE – CORE
===================== */
body.dark {
  background:#0f172a;
  color:#e5e7eb;
}

/* =====================
   PANELS / CONTAINERS
===================== */
body.dark .tool-container,
body.dark .panel,
body.dark .container {
  background:#020617;
  color:#e5e7eb;
  border:1px solid #1e293b;
}

/* =====================
   HEADINGS & TEXT
===================== */
body.dark h1,
body.dark h2,
body.dark h3,
body.dark strong {
  color:#f9fafb;
}

body.dark .subtitle,
body.dark .small,
body.dark .field-info,
body.dark .tooltip,
body.dark .level,
body.dark .timeline-legend {
  color:#94a3b8;
}

/* =====================
   LABELS
===================== */
body.dark label {
  color:#cbd5f5;
}

/* =====================
   INPUTS / SELECTS / TEXTAREA
===================== */
body.dark input,
body.dark select,
body.dark textarea {
  background:#020617;
  color:#e5e7eb;
  border:1px solid #334155;
}

body.dark input::placeholder,
body.dark textarea::placeholder {
  color:#64748b;
}

/* Range sliders */
body.dark input[type="range"] {
  accent-color:#6366f1;
}

/* =====================
   BUTTONS
===================== */
body.dark .btn,
body.dark button {
  background:linear-gradient(135deg,#6366f1,#22c55e);
  color:#ffffff;
}

body.dark .btn.secondary,
body.dark button.secondary {
  background:#020617;
  border:1px solid #334155;
  color:#e5e7eb;
}

body.dark .btn:hover,
body.dark button:hover {
  filter:brightness(1.1);
}

/* =====================
   RESULT / BOXES
===================== */
body.dark .result-box,
body.dark .results,
body.dark .export-area {
  background:#020617;
  border:1px solid #1e293b;
  color:#e5e7eb;
}

/* =====================
   LISTS / INLINE LISTS
===================== */
body.dark .list-inline div {
  background:#020617;
  border:1px solid #334155;
  color:#e5e7eb;
}

/* =====================
   HR / DIVIDERS
===================== */
body.dark hr {
  border-top:1px solid #1e293b;
}

/* =====================
   PREVIEW / STAGES
===================== */
body.dark .preview-stage,
body.dark .timeline {
  background:#020617;
  border:1px solid #1e293b;
}

/* =====================
   CANVAS WRAPS
===================== */
body.dark canvas {
  background:#020617;
  border-radius:8px;
}

/* =====================
   SCROLLBARS (Webkit)
===================== */
body.dark textarea::-webkit-scrollbar-track {
  background:#020617;
}

body.dark textarea::-webkit-scrollbar-thumb {
  background:#475569;
}

body.dark textarea::-webkit-scrollbar-thumb:hover {
  background:#64748b;
}
/* =====================
   DARK MODE – LAYOUT GRID
===================== */

body.dark .layout-grid{
  background:transparent;
}

/* =====================
   PREVIEW AREA
===================== */

body.dark .preview-box{
  background:#020617;
  border:1px solid #1e293b;
}

body.dark .preview-container{
  background:#020617;
  border:1px solid #1e293b;
}

body.dark .preview{
  background:#0f172a;
  color:#e5e7eb;
  border:1px dashed #334155;
}

/* Code preview */
body.dark pre,
body.dark #cssCode{
  background:#020617;
  color:#e5e7eb;
  border:1px solid #1e293b;
}

/* =====================
   STRIPS / BORDERS
===================== */

body.dark .strip{
  opacity:0.85;
}

/* =====================
   ACTION BUTTONS (MIDDLE)
===================== */

body.dark .buttons-box{
  background:#020617;
  border:1px solid #1e293b;
}

body.dark .buttons-box button{
  background:#020617;
  border:1px solid #334155;
  color:#e5e7eb;
}

body.dark .buttons-box button:hover{
  background:#1e293b;
}

/* =====================
   TOOLS PANEL
===================== */

body.dark .tools-box{
  background:#020617;
  border:1px solid #1e293b;
}

/* Cards */
body.dark .card{
  background:#0f172a;
  border:1px solid #1e293b;
  color:#e5e7eb;
}

/* =====================
   INPUTS / SELECTS
===================== */

body.dark .tools-box input,
body.dark .tools-box select{
  background:#020617;
  color:#e5e7eb;
  border:1px solid #334155;
}

body.dark .tools-box input::placeholder{
  color:#64748b;
}

/* Color / Pattern palettes */
body.dark .palette{
  background:#020617;
  border:1px solid #1e293b;
}

/* Draggable colors */
body.dark .draggable-color{
  outline:1px solid #334155;
}

/* Draggable patterns */
body.dark .draggable-pattern{
  color:#e5e7eb;
  border:1px solid #334155;
}

/* Dark mode image area */
body.dark .image-area{
  background: #0f172a;              /* slate-900 */
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

/* Image itself */
body.dark .image-area img{
  background: transparent;
}

/* If you ever overlay text or empty-state inside */
body.dark .image-area::after{
  color: #94a3b8;                    /* slate-400 */
}


/* =====================
   LABELS & TEXT
===================== */

body.dark .tools-box label{
  color:#cbd5f5;
}

body.dark .controls {
  background-color: #1e1e2f;
  border: 1px solid #333;
  color: #ddd;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

body.dark .controls h1 { color: #fff; }
body.dark .controls label { color: #aaa; }
body.dark .controls input,
body.dark .controls select,
body.dark .controls textarea {
  background-color: #2a2a3f;
  color: #fff;
  border: 1px solid #444;
}

body.dark .controls .btn { background: #4a6eff; color: #fff; }
body.dark .controls .btn.small { background: #2f3b5c; }


/* =========================
   TABLE – DARK MODE
========================= */

body.dark table {
  background: #1e1e1e;
  border-color: #333;
}

body.dark th,
body.dark td {
  border: 1px solid #333;
  color: #e0e0e0;
}

/* Header */
body.dark th {
  background-color: #2a2a2a;
  color: #ffffff;
}

/* Zebra rows */
body.dark tr:nth-child(even) {
  background-color: #242424;
}

body.dark tr:nth-child(odd) {
  background-color: #1e1e1e;
}

/* Similarity text */
body.dark .similarity {
  color: #aaa;
}






/* =========================
   Output – Dark
========================= */
.dark .output{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  padding:14px;

  background:
    linear-gradient(180deg, #0f141d, #151b26);

  border-radius:16px;
  border:2px solid rgba(96,165,250,0.55);
  min-height:90px;

  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.6),
    0 6px 20px rgba(0,0,0,0.45);
}

/* =========================
   Word cards – Dark
========================= */
.dark .word-card{
  cursor:grab;
  padding:9px 14px;
  border-radius:12px;

  background:linear-gradient(135deg, #1d4ed8, #2563eb);
  color:#e5edff;
  font-weight:600;

  box-shadow:
    0 6px 18px rgba(0,0,0,0.55),
    0 0 14px rgba(59,130,246,0.35);

  transition: .25s;
}

.dark .word-card:nth-child(odd){
  background:linear-gradient(135deg, #6d28d9, #8b5cf6);
  box-shadow:
    0 6px 18px rgba(0,0,0,0.55),
    0 0 14px rgba(139,92,246,0.35);
}

.dark .word-card:hover{
  transform:translateY(-2px);
  box-shadow:
    0 10px 26px rgba(0,0,0,0.7),
    0 0 18px rgba(96,165,250,0.45);
}

/* =========================
   Separator – Dark
========================= */
.dark .sep-card{
  padding:8px 12px;
  border-radius:10px;

  background:linear-gradient(135deg, #0891b2, #22d3ee);
  color:#ecfeff;
  font-weight:700;

  box-shadow:
    0 4px 14px rgba(0,0,0,0.55),
    0 0 12px rgba(34,211,238,0.35);
}

/* =========================
   Dragging – Dark
========================= */
.dark .dragging{
  opacity:.6;
  transform:scale(1.08);
  filter:brightness(1.15);
}






body.dark .history-item{
  border:1px solid #1e293b;
  border-radius:10px;
  padding:8px 10px;

  background:linear-gradient(180deg,#020617,#0f172a);
  color:#e5e7eb;

  font-size:.86rem;
  line-height:1.4;
  word-break:break-word;
  cursor:grab;

  box-shadow:
    0 4px 12px rgba(0,0,0,0.5),
    inset 0 0 0 1px rgba(255,255,255,0.02);

  transition:all .25s ease;
}


body.dark .history-item:hover{
  transform:translateY(-2px) scale(1.01);

  border-color:#6366f1;

  box-shadow:
    0 10px 24px rgba(0,0,0,0.7),
    0 0 12px rgba(99,102,241,0.35);

  background:linear-gradient(180deg,#020617,#1e293b);
}


body.dark .history-item.dragging{
  opacity:.6;
  transform:scale(1.05);
  box-shadow:
    0 12px 30px rgba(0,0,0,0.8),
    0 0 16px rgba(139,92,246,0.4);
}