/* =====================================================
   EXTRA DOSYALAYICI - Temalar ve Stiller
   ===================================================== */

/* ---------- TEMALAR ---------- */
:root,
[data-theme="gold"] {
  --bg: #0b0b0c;
  --panel: #141416;
  --panel2: #1c1c20;
  --border: #2a2a2f;
  --text: #f3efe4;
  --muted: #8f8a7c;
  --accent: #d4af37;
  --accent2: #f5d76e;
  --glow: rgba(212, 175, 55, 0.28);
  --sel: rgba(212, 175, 55, 0.14);
  --logo: linear-gradient(135deg, #f5d76e, #b8860b);
}

[data-theme="teal"] {
  --bg: #070909;
  --panel: #0f1416;
  --panel2: #162024;
  --border: #203137;
  --text: #e9f8f6;
  --muted: #7ea3a0;
  --accent: #2dd4bf;
  --accent2: #5eead4;
  --glow: rgba(45, 212, 191, 0.25);
  --sel: rgba(45, 212, 191, 0.14);
  --logo: linear-gradient(135deg, #5eead4, #0f766e);
}

[data-theme="purple"] {
  --bg: #07050e;
  --panel: #120c1f;
  --panel2: #1b1231;
  --border: #2e1f4f;
  --text: #f3edff;
  --muted: #9d8fc4;
  --accent: #a855f7;
  --accent2: #e879f9;
  --glow: rgba(168, 85, 247, 0.3);
  --sel: rgba(168, 85, 247, 0.17);
  --logo: linear-gradient(135deg, #c084fc, #6d28d9);
}

/* ---------- TEMEL ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}

h1, h2, h3 { font-family: Outfit, Inter, sans-serif; }
button, input, select, textarea { font-family: inherit; }

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background:
    radial-gradient(circle at 12% 0%, var(--glow), transparent 40%),
    radial-gradient(circle at 100% 100%, var(--glow), transparent 35%);
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 275px 1fr;
  height: 100vh;
}

/* ---------- SOL PANEL ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--panel), var(--bg));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  min-height: 0;
  overflow: hidden;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 6px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.logo {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--logo);
  display: grid; place-items: center;
  font: 800 16px Outfit, sans-serif;
  color: #0b0b0c;
  box-shadow: 0 8px 24px -6px var(--glow);
}
.brand h1 {
  margin: 0;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.32em;
  color: var(--text);
}
.brand small {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.42em;
  font-weight: 600;
}

.nav-title {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 14px 8px 8px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  transition: 0.15s;
}
.nav-btn span { width: 22px; text-align: center; }
.nav-btn:hover { background: var(--panel2); color: var(--text); }
.nav-btn.active {
  background: var(--sel);
  color: var(--accent2);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-btn.drop-hover { outline: 2px solid var(--accent2); }

.tree {
  flex: 1;
  overflow: auto;
  min-height: 60px;
  padding-right: 2px;
}
.tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: 0.12s;
}
.tree-row:hover { background: var(--panel2); }
.tree-row.active { background: var(--sel); color: var(--accent2); }
.tree-row.drop-hover { outline: 2px solid var(--accent2); background: var(--sel); }
.tw { width: 14px; color: var(--muted); font-size: 11px; user-select: none; }
.tw.hide { visibility: hidden; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-foot {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-stats { font-size: 12px; color: var(--muted); }

/* ---------- ANA ALAN ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  backdrop-filter: blur(10px);
}

.crumbs {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  white-space: nowrap;
}
.crumb {
  background: none;
  border: 0;
  color: var(--muted);
  font: 600 14px Outfit, sans-serif;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.crumb:hover { color: var(--accent2); background: var(--sel); }
.crumb.drop-hover { outline: 2px solid var(--accent2); background: var(--sel); color: var(--accent2); }
.crumb-static { font: 600 15px Outfit, sans-serif; color: var(--text); }
.sep-ch { color: var(--muted); }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  min-width: 200px;
  max-width: 340px;
  flex: 1;
}
.search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  padding: 10px 0;
  font-size: 14px;
  min-width: 0;
}

.tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.layout-toggle { display: flex; gap: 6px; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  display: inline-grid;
  place-items: center;
  transition: 0.15s;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.on { border-color: var(--accent); color: var(--accent2); background: var(--sel); }
.menu-btn { display: none; }

.select {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.select:focus { border-color: var(--accent); }

.btn {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 12px;
  cursor: pointer;
  font: 600 13px Inter, sans-serif;
  transition: 0.15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary {
  background: var(--logo);
  color: #0b0b0c;
  border: none;
  box-shadow: 0 8px 22px -8px var(--glow);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: #b91c1c; color: #fff; border: none; }

.new-wrap { position: relative; }
.dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  flex-direction: column;
  z-index: 30;
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.7);
}
.dropdown.show { display: flex; }

.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 22px 8px;
}
.head h2 { margin: 0; font-weight: 800; font-size: 24px; }
.head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); }

.content-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px 22px 22px;
  position: relative;
}

/* ---------- ÖĞELER ---------- */
.content.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 14px;
}
.content.list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px 14px;
  text-align: center;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s, opacity 0.18s;
}
.item::before {
  content: "";
  position: absolute;
  left: 18px; right: 18px; top: 0;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--c, transparent);
}
.item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px -12px var(--glow);
}
.item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.item.selected {
  background: var(--sel);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.item.drop-hover {
  border-color: var(--accent2);
  background: var(--sel);
  box-shadow: 0 0 0 2px var(--accent2) inset, 0 12px 30px -12px var(--glow);
}
.item.folder .ico { filter: drop-shadow(0 4px 10px var(--glow)); }
.dragging .item.selected { opacity: 0.45; }

.item .ico { font-size: 38px; line-height: 1; }
.item .iname {
  font-weight: 600;
  font-size: 14px;
  max-width: 100%;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.item .imeta { font-size: 11px; color: var(--muted); }

/* Liste görünümü */
.content.list .item {
  flex-direction: row;
  display: grid;
  grid-template-columns: 34px 1fr 230px;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 14px;
}
.content.list .item .ico { font-size: 24px; }
.content.list .item .iname { -webkit-line-clamp: 1; text-align: left; }
.content.list .imeta { text-align: right; }

/* Boş durum */
.empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}
.empty-ico { font-size: 56px; margin-bottom: 8px; }
.empty h3 { color: var(--text); margin: 0 0 6px; }

.statusbar {
  padding: 10px 22px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

/* ---------- MODAL ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.overlay.show { display: flex; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: min(440px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  animation: pop 0.2s ease;
}
.modal.modal-wide { width: min(920px, 100%); height: min(86vh, 820px); }

@keyframes pop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 12px 22px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-body {
  padding: 18px 20px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-foot {
  padding: 14px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }

.title-input { font: 700 20px Outfit, sans-serif; }

.note-wrap { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.note-area {
  flex: 1;
  min-height: 300px;
  width: 100%;
  resize: none;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  font: 15px/1.7 Inter, sans-serif;
  outline: none;
}
.note-area:focus { border-color: var(--accent); }
.note-foot {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* Önizleme */
.preview-img { max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; border-radius: 12px; }
video.preview-img { width: 100%; }
audio { width: 100%; }
.preview-frame {
  width: 100%;
  flex: 1;
  min-height: 60vh;
  border: 0;
  border-radius: 12px;
  background: #fff;
}
.preview-text {
  flex: 1;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  padding: 14px;
  border-radius: 12px;
  overflow: auto;
  font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace;
  border: 1px solid var(--border);
}
.nopreview {
  margin: auto;
  text-align: center;
  color: var(--muted);
}
.big-ico { font-size: 72px; margin-bottom: 10px; }

.sheet-wrap { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.sheet-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-btn {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
}
.tab-btn.on { color: #0b0b0c; background: var(--logo); border-color: transparent; }
.sheet-grid {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 200px;
}
.sheet-grid table { border-collapse: collapse; font-size: 13px; }
.sheet-grid td, .sheet-grid th {
  border: 1px solid var(--border);
  padding: 6px 10px;
  white-space: nowrap;
}
.sheet-grid th {
  background: var(--panel2);
  color: var(--accent2);
  position: sticky;
  top: 0;
}

/* Renk seçici */
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.swatch {
  height: 52px;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.15s;
}
.swatch:hover { transform: scale(1.06); border-color: var(--text); }

/* Taşı listesi */
.move-list { display: flex; flex-direction: column; gap: 4px; max-height: 55vh; overflow: auto; }
.move-opt {
  text-align: left;
  background: none;
  border: 0;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: 500 14px Inter, sans-serif;
}
.move-opt:hover:not(:disabled) { background: var(--sel); }
.move-opt:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- BAĞLAM MENÜSÜ ---------- */
.ctx {
  position: fixed;
  display: none;
  min-width: 220px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  z-index: 60;
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.75);
}
.ctx.show { display: block; }
.ctx-item,
.dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--text);
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  font: 500 13px Inter, sans-serif;
}
.ctx-item:hover,
.dropdown button:hover { background: var(--sel); color: var(--accent2); }
.ctx-item.danger { color: #f87171; }
.sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------- SÜRÜKLEME KATMANI ---------- */
.drop-overlay {
  position: fixed;
  inset: 14px;
  border: 2px dashed var(--accent);
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  font: 700 22px Outfit, sans-serif;
  color: var(--accent2);
  z-index: 70;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.drop-overlay.show { display: flex; }

/* ---------- BİLDİRİMLER ---------- */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
  font-size: 13px;
  animation: pop 0.2s ease;
  transition: opacity 0.35s, transform 0.35s;
}
.toast.warn { border-left-color: #f87171; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- MOBİL ---------- */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 280px;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .hint { display: none; }
  .search { min-width: 0; }
  .content.list .item { grid-template-columns: 30px 1fr 110px; }
}
