

/* =========================
   LAYOUT GRID (NEW CORE)
========================= */

body {
  background: transparent;
}

.LAYOUT {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 16px;
  min-height: 30vh;
  padding: 16px;
  box-sizing: border-box;
}

/* Panels */
.panel {
  border-radius: 14px;
  padding: 16px;
  background: #f5f5f5;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* LEFT */
.left-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* CENTER */
.center-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* RIGHT (HISTORY) */
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =========================
   INPUT STYLING (clean)
========================= */

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group input {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  outline: none;
}

/* BUTTON */
button {
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  transform: translateY(-2px);
}

/* =========================
   CENTER RESULT
========================= */

#result {
  font-size: 20px;
  font-weight: 700;
}

/* Progress */
.progress-container {
  height: 16px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  transition: width 0.2s;
}

/* =========================
   RIGHT PANEL (HISTORY)
========================= */

.history-box {
  background: rgba(0,0,0,0.03);
  border-radius: 10px;
  padding: 10px;
  min-height: 200px;
  font-size: 14px;
  color: #555;
}

/* =========================
   DARK MODE FIXES
========================= */

body.dark .LAYOUT {
  background: #020617;
}

body.dark .panel {
  background: #020617;
  border: 1px solid #1e293b;
  color: #e5e7eb;
}

body.dark .history-box {
  background: #0f172a;
  color: #cbd5e1;
}

body.dark input {
  background: #0f172a;
  color: #fff;
  border: 1px solid #334155;
}

body.dark .progress-container {
  background: #1e293b;
}



.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: #e5e7eb;
  color: #111827;
  transition: all 0.2s ease;
}

/* Hover */
.icon-btn:hover {
  transform: translateY(-2px);
}

/* צבעים לפי פעולה */
.icon-load:hover {
  background: #3b82f6;
  color: white;
}

.icon-edit:hover {
  background: #f59e0b;
  color: white;
}

.icon-delete:hover {
  background: #ef4444;
  color: white;
}

/* DARK MODE */
body.dark .icon-btn {
  background: #1e293b;
  color: #cbd5e1;
}

body.dark .icon-load:hover {
  background: #3b82f6;
}

body.dark .icon-edit:hover {
  background: #f59e0b;
}

body.dark .icon-delete:hover {
  background: #ef4444;
}









/* =========================
   TOOLTIP SYSTEM
========================= */

.tooltip {
  position: relative;
}

/* הבועה */
.tooltip-text {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  
  background: #111827;
  color: #fff;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;

  transition: all 0.2s ease;
}

/* החץ הקטן */
.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  
  border-width: 5px;
  border-style: solid;
  border-color: #111827 transparent transparent transparent;
}

/* הופעה */
.tooltip:hover .tooltip-text {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* DARK MODE */
body.dark .tooltip-text {
  background: #020617;
  border: 1px solid #334155;
}

body.dark .tooltip-text::after {
  border-color: #020617 transparent transparent transparent;
}






.history-item {
  position: relative;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  margin-bottom: 10px;
  background: white;
  transition: all 0.2s ease;
}

.history-item:hover {
  background: #f9fafb;
}

/* התוכן */
.history-content {
  pointer-events: none;
}

/* הכפתורים */
.actions {
  position: absolute;
  top: 8px;
  right: 8px;

  display: flex;
  gap: 6px;

  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s ease;
}

/* מופיע ב-hover */
.history-item:hover .actions {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   DARK MODE – HISTORY ITEMS
========================= */

body.dark .history-item {
  background: #020617;            /* רקע כהה */
  border: 1px solid #1e293b;      /* גבול עדין */
  color: #e5e7eb;
}

body.dark .history-item:hover {
  background: #0f172a;            /* hover כהה יותר */
}

/* טקסט משני */
body.dark .history-item small {
  color: #94a3b8;
}

/* =========================
   ACTIONS (כפתורים צפים)
========================= */

body.dark .actions {
  /* לא חובה אבל מוסיף הפרדה עדינה */
}

/* =========================
   OPTIONAL – GLOW עדין ב-hover
========================= */

body.dark .history-item:hover {
  box-shadow: 0 0 0 1px rgba(99,102,241,0.2),
              0 4px 12px rgba(0,0,0,0.6);
}









/* =========================
   CONFIRM MODAL
========================= */

.confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}

.confirm-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.confirm-box {
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 280px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);

  transform: scale(0.95);
  transition: 0.2s;
}

.confirm-modal.active .confirm-box {
  transform: scale(1);
}

.confirm-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

.confirm-actions button {
  flex: 1;
}

/* buttons */
.btn-cancel {
  background: #e5e7eb;
  color: #111;
}

.btn-delete {
  background: #ef4444;
  color: white;
}

/* DARK MODE */
body.dark .confirm-box {
  background: #020617;
  color: #e5e7eb;
  border: 1px solid #1e293b;
}

body.dark .btn-cancel {
  background: #1e293b;
  color: #e5e7eb;
}







/* =========================
   ENTRY ANIMATION
========================= */

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.history-item {
  animation: fadeSlideIn 0.3s ease;
  transition: all 0.2s ease;
}







/* =========================
   DRAG STATE
========================= */

.history-item.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.history-item {
  cursor: grab;
}

.history-item:active {
  cursor: grabbing;
}








.drag-handle {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);

  cursor: grab;
  font-size: 18px;
  color: #94a3b8;

  padding: 4px;
  border-radius: 6px;
  transition: 0.2s;
}

.drag-handle:hover {
  background: #e5e7eb;
  color: #111827;
}

/* DARK MODE */
body.dark .drag-handle:hover {
  background: #1e293b;
  color: #e5e7eb;
}








.history-item {
  transition: transform 0.18s ease, opacity 0.18s ease;
  will-change: transform;
}

/* בזמן גרירה */
.history-item.dragging {
  opacity: 0.6;
  transform: scale(0.98);
  z-index: 10;
}






.fs-btn {
  margin-top: 10px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #22c55e);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.fs-btn:hover {
  transform: translateY(-2px);
}





.LAYOUT:fullscreen {
  background: #0f172a;
  padding: 20px;
}


button.fs-btn.active {
  background: #ef4444 !important;
  color: #ffffff !important;

  font-weight: 700;
  border: none;

  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);

  padding: 12px;
  border-radius: 10px;

  cursor: pointer;
  transition: 0.2s;
}

button.fs-btn.active:hover {
  background: #dc2626 !important;
  transform: translateY(-2px);
}












/* =========================
   HEADER BASE (LIGHT = DEFAULT)
========================= */

.tool-header-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 14px 18px;
  margin-bottom: 16px;

  border-radius: 14px;

  background: linear-gradient(135deg, #ffffff, #f8fafc);
  color: #0f172a;

  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* LEFT */
.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* BRAND */
.brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand-main {
  color: #0f172a;
}

.brand-accent {
  color: #16a34a;
}

/* TITLE */
.title-wrap {
  display: flex;
  flex-direction: column;
}

.tool-header-modern .tool-title {
  font-size: 16px;
  margin: 0;
  font-weight: 700;
  color: #0f172a;
}

.subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* RIGHT SIDE */
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* STATUS */
.status-pill {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;

  background: rgba(22,163,74,0.08);
  color: #16a34a;

  border: 1px solid rgba(22,163,74,0.25);
}

/* THEME */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================
   DARK MODE OVERRIDES
========================= */

body.dark .tool-header-modern {
  background: linear-gradient(135deg, #020617, #0f172a);
  border: 1px solid #1e293b;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

body.dark .brand-main {
  color: #e5e7eb;
}

body.dark .tool-header-modern .tool-title {
  color: #e5e7eb;
}

body.dark .subtitle {
  color: #94a3b8;
}

/* brand accent בדארק יכול להישאר ירוק אבל קצת פחות חזק */
body.dark .brand-accent {
  color: #22c55e;
}

body.dark .status-pill {
  background: rgba(34,197,94,0.12);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.25);
}
