﻿/* =====================
   DARK MODE (REFINED)
===================== */
body.dark {
  --bg: #0f172a;
  --box: #020617;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --heading: #f9fafb;
  --label: #cbd5f5;
  --border: #334155;
  --border-soft: #1e293b;
  --surface-1: #020617;
  --surface-2: #0f172a;
  --thumb: #475569;
  --thumb-hover: #64748b;
  background: var(--bg);
  color: var(--text);
}

body.dark h1,
body.dark h2,
body.dark h3,
body.dark strong,
body.dark .tool-title {
  color: var(--heading);
}

body.dark .small,
body.dark .field-info,
body.dark .subtitle,
body.dark .tooltip,
body.dark .level,
body.dark .timeline-legend,
body.dark #vizNote,
body.dark .graph-legend,
body.dark .similarity,
body.dark .theme-toggle {
  color: var(--muted);
}

body.dark label,
body.dark .tools-box label {
  color: var(--label);
}

body.dark .tool-container,
body.dark .panel,
body.dark .container,
body.dark .results,
body.dark .result-box,
body.dark .export-area,
body.dark .preview-box,
body.dark .preview-container,
body.dark .tools-box,
body.dark .buttons-box,
body.dark .palette,
body.dark pre,
body.dark #cssCode,
body.dark canvas,
body.dark .output-box {
  background: var(--surface-1);
  color: var(--text);
  border: 1px solid var(--border-soft);
}

body.dark .card,
body.dark .preview,
body.dark .controls,
body.dark .image-area {
  background: var(--surface-2);
  color: var(--text);
}

body.dark .preview {
  border: 1px dashed var(--border);
}

body.dark input,
body.dark select,
body.dark textarea,
body.dark .tool-container input,
body.dark .tool-container select,
body.dark .tools-box input,
body.dark .tools-box select,
body.dark .controls input,
body.dark .controls select,
body.dark .controls textarea {
  background: var(--surface-1);
  color: var(--text);
  border: 1px solid var(--border);
}

body.dark .controls input,
body.dark .controls select,
body.dark .controls textarea {
  background-color: #2a2a3f;
  border-color: #444;
  color: #fff;
}

body.dark input::placeholder,
body.dark textarea::placeholder,
body.dark .tool-container input::placeholder,
body.dark .tools-box input::placeholder {
  color: var(--thumb-hover);
}

body.dark .btn,
body.dark button {
  background: linear-gradient(135deg, #6366f1, #22c55e);
  color: #fff;
}

body.dark .btn.secondary,
body.dark button.secondary,
body.dark .buttons-box button {
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text);
}

body.dark .buttons-box button:hover {
  background: var(--border-soft);
}

body.dark hr {
  border-top: 1px solid var(--border-soft);
}

body.dark .list-inline div,
body.dark .draggable-pattern {
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text);
}

body.dark .draggable-color {
  outline: 1px solid var(--border);
}

body.dark .image-area {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

body.dark .image-area img {
  background: transparent;
}

body.dark .image-area::after {
  color: var(--muted);
}

body.dark input[type="range"] {
  accent-color: #6366f1;
}

body.dark textarea::-webkit-scrollbar-track {
  background: var(--surface-1);
}

body.dark textarea::-webkit-scrollbar-thumb {
  background: var(--thumb);
}

body.dark textarea::-webkit-scrollbar-thumb:hover {
  background: var(--thumb-hover);
}

body.dark table {
  background: #1e1e1e;
  border-color: #333;
}

body.dark th,
body.dark td {
  border: 1px solid #333;
  color: #e0e0e0;
}

body.dark th {
  background-color: #2a2a2a;
  color: #fff;
}

body.dark tr:nth-child(even) {
  background-color: #242424;
}

body.dark tr:nth-child(odd) {
  background-color: #1e1e1e;
}









:root{
  --bg:#f4f4f4;          /* רקע גוף בהיר */
  --panel:#f5f5f5;       /* רקע פנל */
  --accent:#007acc;      /* כחול עיקרי */
  --accent2:#00aaff;     /* כחול משני */
  --text:#333;           /* טקסט כהה */
  --muted:#555;          /* טקסט משני */
  --shadow:rgba(0,122,204,0.25);
  --radius:12px;
}






body {
  margin: 0;
  display: flex;
  padding:2rem;
  justify-content: center; /* מרכז אופקית */
  align-items: flex-start;
  
  background: transparent;     /* או dark */
}

.container{
 
  margin:auto;
  border-radius:var(--radius);
  border:1px solid var(--shadow);
  background: linear-gradient(145deg, #f5f5f5, #d0e6ff);
  padding: 25px;
  box-shadow: 0 8px 20px rgba(0,122,204,0.15), 0 0 30px rgba(37,99,235,0.1);
}

header{
  grid-column:1/-1;
  margin-bottom:1rem;
}



p.lead{
  margin:.3rem 0 .75rem;
  color:var(--muted);
  font-size:.95rem;
}

.panel{
  background:var(--panel);
  padding:1.5rem;
  border-radius:var(--radius);
  border:0;
  color:var(--text);
  box-shadow: inset 0 2px 8px rgba(0,122,204,0.05);
}

label{
  display:block;
  font-size:.9rem;
  margin:.35rem 0;
  color:var(--muted);
}

input[type=text], textarea, select{
  width:92%;
  padding:.7rem;
  border-radius:10px;
  border:1px solid rgba(0,122,204,0.25);
  background: #eef6ff;
  color:var(--text);
  outline:none;
  transition:border-color 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 2px 6px rgba(0,122,204,0.05);
}

input[type=text]:focus, textarea:focus, select:focus{
  border-color:var(--accent);
  box-shadow:0 0 12px var(--shadow);
}

textarea{min-height:130px;}

select option {
  background-color:#eef6ff;
  color:var(--text);
}

.row{display:flex;gap:.6rem;}
.row .flex{flex:1;}

.actions{
  display:flex;
  gap:.5rem;
  align-items:center;
  margin-top:.8rem;
}

button{
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0,122,204,0.25);
}

button:hover{
  background: linear-gradient(135deg, #0b60cc, #1fa1dd);
  box-shadow: 0 6px 18px rgba(0,122,204,0.35);
  transform: translateY(-1px);
}

button.ghost{
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(0,122,204,0.25);
}

button.ghost:hover{
  background: rgba(0,122,204,0.1);
  color: #fff;
  box-shadow: 0 0 12px 3px rgba(0,122,204,0.5), 0 0 24px 8px rgba(0,122,204,0.15);
}

.preview{
  width:98%;
  padding:.7rem;
  border-radius:10px;
  border:1px solid rgba(0,122,204,0.25);
  background:#eef6ff;
  color:var(--text);
  outline:none;
  transition:border-color 0.2s, box-shadow 0.2s;
}

.small{font-size:.85rem;color:var(--muted)}

footer{
  grid-column:1/-1;
  margin-top:1rem;
  color:var(--muted);
  font-size:.85rem;
  text-align:center;
}

/* סקרולר מעוצב */
::-webkit-scrollbar{width:10px}
::-webkit-scrollbar-track{background:#e0f4ff}
::-webkit-scrollbar-thumb{background:var(--accent);border-radius:10px}
::-webkit-scrollbar-thumb:hover{background:var(--accent2)}

@media(max-width:980px){
  .container{grid-template-columns:1fr}
}

/* =====================
   MINI SAAS PANELS
===================== */
.saas-panel {
  margin-top: 1rem;
}

.saas-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.saas-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.saas-item {
  padding: 0.6rem;
  border: 1px solid rgba(0, 122, 204, 0.2);
  border-radius: 10px;
  background: #eef6ff;
}

.saas-item-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.saas-item-url {
  font-size: 0.82rem;
  word-break: break-all;
  color: var(--text);
}

.saas-item-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

.panel-btn {
  padding: 6px 10px;
  font-size: 0.75rem;
}

.panel-btn-xs {
  padding: 4px 8px;
  font-size: 0.72rem;
}

.history-highlight {
  border-color: #22a3f5 !important;
  box-shadow: 0 0 0 2px rgba(34, 163, 245, 0.18);
}

.status-message {
  min-height: 1.1rem;
  margin: 0.45rem 0 0;
}

.status-message.is-success {
  color: #0f8a52;
}

.status-message.is-error {
  color: #c0392b;
}

input.is-invalid {
  border-color: #d9534f !important;
  box-shadow: 0 0 0 2px rgba(217, 83, 79, 0.15);
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

body.dark .saas-item {
  background: #0f172a;
  border-color: #334155;
}

body.dark .status-message.is-success {
  color: #4ade80;
}

body.dark .status-message.is-error {
  color: #f87171;
}

/* =====================
   LEFT HISTORY SIDEBAR
===================== */
.app-layout {
  width: min(1500px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr minmax(260px, 320px);
  gap: 1rem;
  height: 100%;
  position: relative;
}

.app-column {
  
  overflow-y: auto;
}

#full-screen {
  width: 100%;
}

.fullscreen-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
}

.app-column-left,
.app-column-right {
  position: sticky;
  top: 0;
}

.history-sidebar .saas-list {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  padding-right: 0.15rem;
}

@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .app-column {
    height: auto;
    max-height: 65vh;
  }

  .app-column-left,
  .app-column-right {
    position: static;
  }

  .history-sidebar .saas-list {
    max-height: 240px;
  }
}

/* =====================
   CONTROL SIDEBAR
===================== */
.control-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.control-sidebar-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: inherit;
  border-bottom: 1px solid rgba(0, 122, 204, 0.15);
  padding-bottom: 0.5rem;
}

.control-sidebar-title {
  margin: 0 0 0.25rem;
  font-size: 1.08rem;
}

.control-section {
  border: 1px solid rgba(0, 122, 204, 0.15);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.35);
}

.control-section-title {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.control-sidebar .field {
  margin-bottom: 0.65rem;
}

.control-sidebar .field:last-child {
  margin-bottom: 0;
}

.control-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0;
}

.control-actions button {
  width: 100%;
  justify-content: center;
}

.primary-action {
  box-shadow: 0 8px 18px rgba(0, 122, 204, 0.28);
}

body.dark .control-sidebar-header {
  border-bottom-color: #334155;
}

body.dark .control-section {
  background: #0f172a;
  border-color: #334155;
}

body.dark .control-section-title {
  color: #94a3b8;
}

/* =====================
   UI POLISH LAYER
===================== */
.app-layout {
  gap: 1.15rem;
}

.app-column {
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(2, 32, 71, 0.08);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.app-column:hover {
  box-shadow: 0 10px 24px rgba(2, 32, 71, 0.12);
}

label {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.small {
  line-height: 1.45;
}

.control-sidebar {
  gap: 1rem;
}

.control-sidebar-header {
  backdrop-filter: blur(4px);
  padding-bottom: 0.7rem;
  margin-bottom: 0.15rem;
}

.control-sidebar-title {
  font-size: 1.14rem;
  letter-spacing: 0.01em;
}

.control-section {
  padding: 0.85rem;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 3px 10px rgba(0, 122, 204, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.control-section:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 8px 16px rgba(0, 122, 204, 0.1);
}

input[type=text], textarea, select, .preview {
  border-radius: 12px;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

textarea {
  line-height: 1.45;
}

button {
  border-radius: 12px;
  transition: transform 0.18s ease, box-shadow 0.22s ease, background-color 0.22s ease, color 0.22s ease;
}

button:hover {
  transform: translateY(-2px);
}

.control-actions button {
  min-height: 40px;
}

.primary-action {
  box-shadow: 0 10px 22px rgba(0, 122, 204, 0.28);
}

.primary-action:hover {
  box-shadow: 0 12px 26px rgba(0, 122, 204, 0.34);
}

.saas-item {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 122, 204, 0.08);
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.saas-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 122, 204, 0.14);
}

.panel-btn,
.panel-btn-xs {
  border-radius: 10px;
}

body.dark .app-column {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

body.dark .app-column:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

body.dark .control-section {
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.08), 0 6px 14px rgba(0, 0, 0, 0.28);
}

body.dark .control-section:hover {
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.12), 0 10px 20px rgba(0, 0, 0, 0.34);
}

body.dark .saas-item {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
