/* =====================================================
   3D LOGO ROTATOR – V2 PREMIUM UI
   Glass / Dark Tech / Responsive / Clean System
===================================================== */

:root {
  --bg: #0b0f1a;
  --panel: rgba(255,255,255,0.06);
  --panel-strong: rgba(255,255,255,0.10);
  --text: #e6eaf2;
  --muted: rgba(230,234,242,0.65);
  --accent: #00ffc3;
  --accent2: #4f8cff;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 20px 60px rgba(0,0,0,0.55);
}

/* =========================
   GLOBAL RESET
========================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial;
  background: radial-gradient(circle at top, #111827, #05070d);
  color: var(--text);
}

/* =========================
   ARTICLE WRAPPER
========================= */

.tool-article {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
}

/* =========================
   INTRO SECTION
========================= */

.intro-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 30px;
}

.intro-image img {
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.intro-text h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

.intro-text p {
  color: var(--muted);
  line-height: 1.6;
}

.save-tool-btn {
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  transition: 0.25s;
}

.save-tool-btn:hover {
  background: var(--panel-strong);
  transform: translateY(-2px);
}

/* =========================
   TOOL WRAPPER
========================= */

.tool {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* =========================
   MAIN LAYOUT
========================= */

.guy {
  display: flex;
  min-height: 650px;
  position: relative;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
  width: 280px;
  background: rgba(10,14,25,0.8);
  border-right: 1px solid var(--border);
  padding: 16px;
  backdrop-filter: blur(10px);
}

.sidebar-title {
  margin: 0;
  font-size: 1.2rem;
  color: #1d4ed8;
}

body.dark .sidebar-title {
  color: #c7d2fe;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar h3 {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.sidebar button {
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: #fff;
  font-weight: 700;
  border-radius: 6px;
  box-shadow: 0 6px 12px rgba(37, 99, 235, 0.2);
}

.sidebar button:hover {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35), 0 0 24px rgba(96, 165, 250, 0.2);
  transform: translateY(-2px);
}

.sidebar-actions {
  display: grid;
  gap: 8px;
}

/* =========================
   MOBILE SIDEBAR TOGGLE
========================= */

.sidebar-toggle {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 999;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
}

/* =========================
   MAIN CONTENT
========================= */

.main-content {
  flex: 1;
  padding: 20px;
  overflow: hidden;
}

.tool-header {
  margin-bottom: 10px;
}

.tool-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
}

/* =========================
   BODY SCROLL AREA
========================= */



/* =========================
   CONTROLS PANEL
========================= */

#controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  background: rgba(255,255,255,0.04);
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 15px;
}

#controls input,
#controls select {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px;
  border-radius: 8px;
}

/* =========================
   FIELDSET
========================= */

fieldset {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

legend {
  color: var(--muted);
}

/* =========================
   CANVAS
========================= */

#canvas {
  display: block;
  margin: 20px auto;
  border-radius: 16px;
  background: #0a0f1c;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

/* =========================
   EMBED BOX
========================= */

.embed-box {
  margin-top: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 14px;
}

.embed-code textarea {
  width: 100%;
  height: 120px;
  background: rgba(0,0,0,0.4);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

/* =========================
   BUTTONS
========================= */

button {
  transition: 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

/* =========================
   FULLSCREEN BUTTON
========================= */

.fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}

/* =========================
   HISTORY LIST
========================= */

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.history-list li {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.history-item {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 122, 204, 0.25);
  background: #f8fbff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.15);
}

.history-item.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.history-item-head {
  display: flex;
  gap: 6px;
  align-items: center;
}

.history-item-head input {
  flex: 1;
  min-width: 0;
}

.history-item-controls {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.history-item-controls button {
  flex: 1;
  padding: 6px 8px;
}

.history-empty {
  margin-top: 8px;
  color: #64748b;
}


body.dark .history-item {
  background: #0b1220;
  border-color: #334155;
}

body.dark .history-empty {
  color: #94a3b8;
}



/* =========================
   Help Guide
========================= */

.help-guide {
  margin-top: 18px;
  width: 100%;
  max-width: 980px;
}

.help-accordion {
  border-radius: 14px;
  border: 1px solid rgba(0, 122, 204, 0.25);
  background: linear-gradient(145deg, #f8fbff, #eef6ff);
  overflow: hidden;
}

.help-accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  color: #1e3a8a;
}

.help-accordion summary::-webkit-details-marker {
  display: none;
}

.help-content {
  padding: 0 16px 14px;
}

.help-content h2,
.help-content h3 {
  margin: 14px 0 8px;
}

.help-content p,
.help-content li {
  line-height: 1.55;
}

.help-content ul,
.help-content ol {
  margin: 8px 0 0 20px;
}



body.dark .help-accordion {
  border-color: #334155;
  background: linear-gradient(145deg, #0b1220, #111827);
}

body.dark .help-accordion summary {
  color: #c7d2fe;
}
/* =========================
   SIMILAR TOOLS
========================= */

.similar-tools {
  margin-top: 20px;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .guy {
    flex-direction: column;
  }

  .sidebar {
    position: absolute;
    left: -300px;
    top: 0;
    height: 100%;
    transition: 0.3s;
    z-index: 999;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-toggle {
    display: block;
  }
}











/* =====================================================
   NEW 2-COLUMN OVERLAP LAYOUT
   Sidebar + Main on top
   Embed / Similar / Help below both columns
===================================================== */

/* FIX TYPO IN HTML:
<section class="tool>  ==>  <section class="tool">
*/

/* =========================
   TOOL CONTAINER
========================= */
.tool{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  padding: 18px;
}

/* =========================
   MASTER WRAPPER
========================= */
.wrapper{
  display: grid;
  grid-template-columns: 290px minmax(0,1fr);
  gap: 18px;
  align-items: start;
}

/* כל האלמנטים שמתחת ל-2 עמודות */
.embed-box,
.similar-tools,
.help-guide,
.tool-disclaimer{
  grid-column: 1 / -1;
}

/* =========================
   SIDEBAR COLUMN
========================= */
.sidebar{
  width: 100%;
  position: sticky;
  top: 18px;
  align-self: start;

  background: rgba(10,14,25,.88);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(12px);
}

/* =========================
   MAIN COLUMN
========================= */
.guy{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

/* =========================
   HEADER
========================= */
.tool-header{
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
}

/* =========================
   MAIN BODY
========================= */
.boy{
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  overflow: hidden;
}

/* =========================
   CONTROLS
========================= */
#controls{
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(170px,1fr));
  gap: 12px;

  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

/* =========================
   CANVAS
========================= */
#canvas{
  display:block;
  margin: 22px auto;
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

/* =========================
   BELOW SECTION BOXES
========================= */
.embed-box,
.similar-tools,
.help-guide,
.tool-disclaimer{
  margin-top: 0;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

/* =========================
   FULLSCREEN BTN
========================= */
.fullscreen-btn{
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 980px){

  .wrapper{
    grid-template-columns: 1fr;
  }

  .sidebar{
    position: relative;
    top: auto;
    order: 1;
  }

  .guy{
    order: 2;
  }

  .embed-box,
  .similar-tools,
  .help-guide,
  .tool-disclaimer{
    grid-column: auto;
  }
}

/* =========================
   SMALL MOBILE
========================= */
@media (max-width: 700px){

  .tool{
    padding: 12px;
  }

  .boy,
  .sidebar,
  .tool-header,
  .embed-box,
  .similar-tools,
  .help-guide{
    padding: 14px;
  }

  #controls{
    grid-template-columns: 1fr;
  }
}

/* FORCE TWO COLUMN LAYOUT */

#wrapper{
display:grid !important;
grid-template-columns:280px 1fr !important;
gap:20px;
align-items:start;
}

#wrapper > .sidebar{
grid-column:1;
}

#wrapper > .guy{
grid-column:2;
min-width:0;
}

#wrapper > .embed-box,
#wrapper > .similar-tools,
#wrapper > .help-guide,
#wrapper > .tool-disclaimer{
grid-column:1 / -1 !important;
}

/* MOBILE */
@media(max-width:900px){

#wrapper{
grid-template-columns:1fr !important;
}

#wrapper > *{
grid-column:auto !important;
}

}








/* LOCK FINAL LAYOUT */

body .tool .wrapper,
body #wrapper{
display:grid !important;
grid-template-columns:280px minmax(0,1fr) !important;
gap:20px !important;
max-width:100% !important;
width:100% !important;
margin:0 !important;
align-items:start !important;
}

/* sidebar */
body #wrapper > .sidebar{
grid-column:1 !important;
width:100% !important;
position:sticky !important;
top:20px !important;
left:auto !important;
}

/* main */
body #wrapper > .guy{
grid-column:2 !important;
display:flex !important;
flex-direction:column !important;
width:100% !important;
min-width:0 !important;
}

/* lower sections */
body #wrapper > .embed-box,
body #wrapper > .similar-tools,
body #wrapper > .help-guide,
body #wrapper > .tool-disclaimer{
grid-column:1 / -1 !important;
width:100% !important;
}

/* desktop stop collapse */
@media(min-width:901px){

body #wrapper{
grid-template-columns:280px minmax(0,1fr) !important;
}

}

/* mobile */
@media(max-width:900px){

body #wrapper{
grid-template-columns:1fr !important;
}

body #wrapper > *{
grid-column:auto !important;
position:relative !important;
top:auto !important;
}

}






.sidebar-btn{
width:100%;
padding:12px 14px;
border:none;
border-radius:12px;
cursor:pointer;
font-size:15px;
font-weight:600;

background:linear-gradient(135deg,#1e293b,#0f172a);
color:#fff;

transition:.25s ease;
}

.sidebar-btn:hover{
transform:translateY(-2px);
opacity:.95;
}















/* =====================================================
   LIGHT / DARK THEME SYSTEM
   להדביק בסוף הקובץ בלבד
   לא נוגע במבנה שעובד לך
===================================================== */

/* =========================
   DARK = ברירת מחדל
========================= */
body.dark{
  --bg:#0b0f1a;
  --panel:rgba(255,255,255,0.06);
  --panel-strong:rgba(255,255,255,0.10);
  --text:#e6eaf2;
  --muted:rgba(230,234,242,0.65);
  --border:rgba(255,255,255,0.08);
  --shadow:0 20px 60px rgba(0,0,0,0.55);

  background:radial-gradient(circle at top,#111827,#05070d);
  color:var(--text);
}

/* =========================
   LIGHT MODE
========================= */
body:not(.dark){
  --bg:#f4f7fb;
  --panel:#ffffff;
  --panel-strong:#f8fafc;
  --text:#0f172a;
  --muted:#475569;
  --border:#dbe3ee;
  --shadow:0 20px 50px rgba(15,23,42,0.08);

  background:linear-gradient(180deg,#f8fbff,#eef3f9);
  color:var(--text);
}

/* =========================
   AUTO APPLY COLORS
========================= */

body .tool,
body .sidebar,
body .tool-header,
body .boy,
body .embed-box,
body .similar-tools,
body .help-guide,
body .tool-disclaimer,
body #controls{
  background:var(--panel) !important;
  color:var(--text) !important;
  border-color:var(--border) !important;
  box-shadow:var(--shadow);
}

/* =========================
   TEXT
========================= */

body h1,
body h2,
body h3,
body h4,
body h5,
body h6,
body p,
body li,
body label,
body span,
body strong,
body legend{
  color:var(--text);
}

body .intro-text p,
body .sidebar h3,
body .history-list li,
body .tool-disclaimer,
body .help-guide p{
  color:var(--muted) !important;
}

/* =========================
   INPUTS
========================= */

body input,
body select,
body textarea{
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid var(--border) !important;
}

body.dark input,
body.dark select,
body.dark textarea{
  background:rgba(0,0,0,.35) !important;
  color:#e6eaf2 !important;
}

/* =========================
   BUTTONS
========================= */

body button{
  color:var(--text);
  border:1px solid var(--border);
  background:var(--panel-strong);
}

body button:hover{
  filter:brightness(1.03);
}

/* =========================
   SIDEBAR THEME BUTTON
========================= */

body:not(.dark) .sidebar-btn{
  background:linear-gradient(135deg,#ffffff,#edf2f7);
  color:#0f172a;
  border:1px solid #dbe3ee;
}

body.dark .sidebar-btn{
  background:linear-gradient(135deg,#1e293b,#0f172a);
  color:#fff;
}

/* =========================
   CANVAS AREA
========================= */

body:not(.dark) #canvas{
  background:#e9eef5;
}

body.dark #canvas{
  background:#0a0f1c;
}

/* =========================
   TEXTAREA EMBED
========================= */

body:not(.dark) .embed-code textarea{
  background:#f8fafc !important;
  color:#111827 !important;
}

body.dark .embed-code textarea{
  background:rgba(0,0,0,.4) !important;
  color:#e6eaf2 !important;
}