
/* =========================
   SAAS UI V2 – LIGHT + DARK
========================= */

:root{
  --bg: #f6f7ff;
  --card: rgba(255,255,255,0.75);
  --card-solid: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --accent: #6366f1;
  --accent2: #22c55e;
  --shadow: 0 10px 30px rgba(0,0,0,0.06);
  --radius: 16px;
  font-family: ui-sans-serif, system-ui;
}

/* =========================
   DARK MODE
========================= */

body.dark{
  --bg: #0b1220;
  --card: rgba(15, 23, 42, 0.75);
  --card-solid: #0f172a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 18px 50px rgba(0,0,0,0.5);
}

/* =========================
   BASE
========================= */

body{
  margin:0;
  background: radial-gradient(circle at top, var(--bg), transparent 70%);
  color: var(--text);
}

/* =========================
   GRID
========================= */

.app-layout{
  display:grid;
  grid-template-columns: 280px minmax(0,1fr) 280px;
  gap:18px;
  padding:18px;
  min-height:30vh;
}

/* =========================
   SIDEBARS
========================= */

.sidebar{
  position:sticky;
  top:18px;
  min-height:30vh;
  overflow:auto;

  background: var(--card);
  backdrop-filter: blur(16px);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);

  padding:16px;
  transition:0.25s ease;
}

.sidebar:hover{
  transform: translateY(-2px);
}

.sidebar h3{
  font-size:12px;
  letter-spacing:1px;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:12px;
}

/* =========================
   INPUTS
========================= */

.controls-panel{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.input{
  background: var(--card-solid);
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  transition:0.2s ease;
}

.input:focus-within{
  border-color: var(--accent);
  box-shadow:0 0 0 3px rgba(99,102,241,0.2);
}

input, select{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  color:var(--text);
}

/* =========================
   BUTTONS
========================= */

.btn, .save-btn, .copy-btn{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color:#fff;
  border:none;
  border-radius:12px;
  padding:10px 14px;
  font-weight:700;
  cursor:pointer;
  transition:0.2s ease;
}

.btn:hover,
.save-btn:hover,
.copy-btn:hover{
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.08);
}

/* =========================
   MAIN
========================= */

.main{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-width:0;
}

.main-header{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:18px;
  box-shadow: var(--shadow);
}

.main-header h1{
  margin:0;
  font-size:22px;
}

.main-header p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:13px;
}

/* =========================
   PREVIEW
========================= */

.preview{
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:18px;
  min-height:30vh;
  box-shadow: var(--shadow);
  color: #111;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow:auto;
}

/* כי האלמנט הוא ID בשם preview ולא class בשם preview */

#preview{
  display:block !important;
  box-sizing:border-box !important;
  width:100% !important;

  padding:18px !important;
  min-height:30vh !important;
  overflow:auto !important;
  white-space:pre-wrap !important;
  word-break:break-word !important;

  border-radius:18px !important;
  font-family:ui-monospace, SFMono-Regular, Menlo, monospace !important;
  line-height:1.55 !important;

  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid #e2e8f0 !important;
  box-shadow:0 10px 30px rgba(15,23,42,.06) !important;
}

/* מצב כהה */
body.dark #preview,
html.dark #preview,
[data-theme="dark"] #preview{
  background:#0f172a !important;
  color:#f8fafc !important;
  border-color:rgba(255,255,255,.08) !important;
  box-shadow:0 12px 30px rgba(0,0,0,.35) !important;
}

/* =========================
   SAVED ITEMS
========================= */

.saved-item{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px;
  margin-bottom:10px;
  box-shadow:0 6px 18px rgba(0,0,0,0.04);
  transition:0.2s ease;
  cursor:grab;
  position:relative;
}

.saved-item:hover{
  transform: translateY(-2px);
}

.saved-item:active{
  cursor:grabbing;
  transform: scale(0.98);
}

.saved-title{
  font-weight:700;
  font-size:13px;
}

.saved-date{
  font-size:11px;
  color:var(--muted);
}

.saved-actions button{
  font-size:11px;
  padding:4px 8px;
  border-radius:8px;
  border:1px solid var(--border);
  background:transparent;
  color:var(--text);
  cursor:pointer;
}

/* drag handle */
.saved-item::before{
  content:"⋮⋮";
  position:absolute;
  left:6px;
  top:10px;
  color:var(--muted);
}

/* =========================
   COLOR PALETTE
========================= */

.color-palette{
  display:flex;
  gap:6px;
  margin-top:6px;
}

.color-palette span{
  width:12px;
  height:12px;
  border-radius:50%;
  cursor:pointer;
}

/* =========================
   RESPONSIVE
========================= */

@media(max-width:1100px){
  .app-layout{
    grid-template-columns:1fr;
  }

  .sidebar{
    position:relative;
    height:auto;
  }
}



.color-palette span{
  width:14px;
  height:14px;
  border-radius:50%;
  cursor:pointer;
  border:2px solid transparent;
  transition:0.2s ease;
}

.color-palette span:hover{
  transform: scale(1.25);
  border:2px solid rgba(255,255,255,0.8);
  box-shadow:0 4px 10px rgba(0,0,0,0.15);
}




/* =========================
   FIX COLOR DOT VISIBILITY
========================= */

.color-palette{
  display:flex;
  gap:8px;
  margin-top:8px;
}

.color-palette span{
  width:16px;
  height:16px;
  border-radius:50%;
  cursor:pointer;

  display:inline-block;

  /* 🔥 זה מה שחסר לך */
  border:2px solid rgba(0,0,0,0.15);
  box-shadow:0 2px 6px rgba(0,0,0,0.15);

  transition:0.2s ease;
}

.color-palette span:hover{
  transform:scale(1.3);
  border-color: rgba(255,255,255,0.9);
  box-shadow:0 6px 14px rgba(0,0,0,0.25);
}

/* DARK MODE FIX */
body.dark .color-palette span{
  border:2px solid rgba(255,255,255,0.25);
  box-shadow:0 2px 8px rgba(0,0,0,0.4);
}


.color-palette span{
  width:14px;
  height:14px;
  border-radius:50%;
  display:inline-block !important;
  cursor:pointer;

  /* חשוב מאוד */
  background: red;
}

/* FORCE COLORS (לא ניתן לדריסה) */
.color-palette span:nth-child(1){
  background:#6366f1 !important;
}

.color-palette span:nth-child(2){
  background:#22c55e !important;
}

.color-palette span:nth-child(3){
  background:#f97316 !important;
}

.color-palette span:nth-child(4){
  background:#ef4444 !important;
}



.color-palette span{
  width:14px;
  height:14px;
  border-radius:50%;
  cursor:pointer;
  display:inline-block;
  transition:0.2s ease;
  border:2px solid transparent;
}

.color-palette span:hover{
  transform: scale(1.3);
}

/* active color indicator */
.saved-item[data-color="#6366f1"] .color-palette span:nth-child(1),
.saved-item[data-color="#22c55e"] .color-palette span:nth-child(2),
.saved-item[data-color="#f97316"] .color-palette span:nth-child(3),
.saved-item[data-color="#ef4444"] .color-palette span:nth-child(4){
  border:2px solid #111;
  transform: scale(1.2);
}






.filter-bar{
  display:flex;
  gap:6px;
  margin-bottom:10px;
  flex-wrap:wrap;
}

.filter-bar button{
  font-size:11px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,0.1);
  background:white;
  cursor:pointer;
  transition:0.2s;
}

.filter-bar button:hover{
  transform:scale(1.05);
}




.active-indicator{
  margin:10px 0;
  padding:8px 12px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  gap:8px;

  font-size:12px;
  font-weight:600;

  background: rgba(255,255,255,0.7);
  border:1px solid rgba(0,0,0,0.08);
  backdrop-filter: blur(10px);
}

.active-dot{
  width:10px;
  height:10px;
  border-radius:50%;
}


body.dark .active-indicator{
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255,255,255,0.08);
  color: #e5e7eb;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

body.dark .active-indicator span{
  color: #e5e7eb;
}

body.dark .active-dot{
  box-shadow: 0 0 10px rgba(255,255,255,0.15);
}






.fs-btn{
  width:100%;
  margin-bottom:10px;
  padding:10px 12px;
  border-radius:12px;

  border:1px solid rgba(0,0,0,0.08);
  background: linear-gradient(135deg, #6366f1, #22c55e);
  color:#fff;

  font-weight:700;
  cursor:pointer;

  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  transition:0.2s ease;
}

.fs-btn:hover{
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.1);
}

/* DARK */
body.dark .fs-btn{
  border:1px solid rgba(255,255,255,0.1);
  box-shadow:0 8px 20px rgba(0,0,0,0.4);
}





/* fullscreen container feel */
.app-layout:fullscreen{
  background:#0b1220;
  padding:20px;
  gap:20px;
}

/* smoother look inside fullscreen */
.app-layout:fullscreen .sidebar,
.app-layout:fullscreen .main{
  height: calc(100vh - 40px);
}

/* optional: nicer shadow removal in fullscreen */
.app-layout:fullscreen .sidebar,
.app-layout:fullscreen .main-header,
.app-layout:fullscreen .preview{
  box-shadow:0 0 0 transparent;
}











/* =========================
   SEO SECTION
========================= */

.seo-section,
.faq-section{
  margin-top:40px;
  padding:20px;
}

.seo-container{
  max-width:900px;
  margin:auto;
  background:rgba(255,255,255,0.7);
  border:1px solid rgba(0,0,0,0.08);
  border-radius:16px;
  padding:24px;
  backdrop-filter:blur(10px);
}

.seo-container h2{
  margin-top:0;
}

.seo-container h3{
  margin-top:20px;
}

.seo-container p,
.seo-container li{
  color:#555;
  line-height:1.6;
}

/* FAQ */
.faq-item{
  margin-top:15px;
  padding:12px;
  border-left:3px solid #6366f1;
  background:rgba(255,255,255,0.6);
  border-radius:10px;
}

.faq-item h4{
  margin:0 0 6px;
}

/* =========================
   DARK MODE
========================= */

body.dark .seo-container{
  background:rgba(15,23,42,0.7);
  border:1px solid rgba(255,255,255,0.08);
}

body.dark .seo-container p,
body.dark .seo-container li{
  color:#cbd5f5;
}

body.dark .faq-item{
  background:rgba(15,23,42,0.6);
  border-left:3px solid #818cf8;
}









/* =========================
   FULLSCREEN SCROLL FIX
========================= */

/* הגובה של כל המערכת */
.app-layout:fullscreen{
  height:100vh;
  overflow:hidden;
}

/* חשוב מאוד */
.app-layout:fullscreen .main{
  display:flex;
  flex-direction:column;
  height:100%;
  min-height:0;
}

/* החלק שצריך לגלול */
.app-layout:fullscreen .editor{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
}

/* results תופס מקום */
.app-layout:fullscreen .results{
  flex:1;
  min-height:0;
}

/* כאן קורה הקסם */
.app-layout:fullscreen .preview{
  height:90%;
  overflow:auto;
}
