/* ============================
   TIPS & TRICKS — Filesystem Tree
   Ergänzt css/styles.css
   ============================ */

.tips-content { padding: 48px 0 96px; }
.tips-wrap { max-width: 900px; margin: 0 auto; }

/* --- Toolbar --- */
.tips-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tips-search {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}
.tips-search svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.tips-search input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--text-1);
  padding: 11px 14px 11px 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.tips-search input::placeholder { color: var(--text-3); }
.tips-search input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.tips-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  white-space: nowrap;
  transition: color var(--dur), border-color var(--dur), background var(--dur), transform var(--dur);
}
.tips-tool-btn:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-dim);
  transform: translateY(-1px);
}

/* --- States --- */
.tips-state {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg-alt);
  padding: 40px 28px;
  text-align: center;
  color: var(--text-2);
  font-size: 15px;
}
.tips-state-icon { font-size: 30px; display: block; margin-bottom: 12px; }
.tips-state-title {
  font-size: 17px; font-weight: 700; color: var(--text-1);
  margin-bottom: 8px; letter-spacing: -0.2px;
}
.tips-state-error {
  border-color: rgba(220, 38, 38, 0.30);
  background: rgba(220, 38, 38, 0.05);
}
.tips-state-error .tips-state-title { color: #b91c1c; }
.tips-state-detail {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  max-width: 100%;
  overflow-x: auto;
  text-align: left;
}

/* --- Tree --- */
.tips-tree {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.tips-tree ul { list-style: none; margin: 0; padding: 0; }

/* Verschachtelte Ebenen bekommen die Filesystem-Linie */
.tips-tree ul.tips-node-children {
  position: relative;
  margin: 0 0 0 30px;
  padding-left: 0;
  border-left: 1px solid var(--border-strong);
}

.tips-node { position: relative; }
.tips-node + .tips-node > .tips-row { border-top: 1px solid var(--border); }

/* --- Zeile (Kategorie / Artikel) --- */
.tips-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  font: inherit;
  color: var(--text-1);
  background: transparent;
  transition: background var(--dur), color var(--dur);
}
.tips-row:hover { background: var(--accent-dim); }
.tips-row:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: -2px;
}

.tips-chevron {
  flex: 0 0 auto;
  width: 16px; height: 16px;
  color: var(--text-3);
  transition: transform var(--dur) var(--ease), color var(--dur);
}
.tips-node.open > .tips-row .tips-chevron { transform: rotate(90deg); color: var(--accent); }
.tips-row:hover .tips-chevron { color: var(--accent); }

.tips-icon {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  border-radius: 9px;
  background: var(--bg-alt2);
  border: 1px solid var(--border);
}
.tips-node-article > .tips-row .tips-icon {
  background: var(--accent-dim);
  border-color: var(--accent-border);
}

.tips-label { flex: 1 1 auto; min-width: 0; }
.tips-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-1);
}
.tips-node-cat > .tips-row .tips-title { font-weight: 700; }
.tips-node-lvl0 > .tips-row .tips-title { font-size: 16px; }
.tips-sub {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.5;
}

.tips-count {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-3);
  background: var(--bg-alt2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 9px;
}

.tips-copy-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  color: var(--text-3);
  opacity: 0;
  transition: opacity var(--dur), color var(--dur), background var(--dur);
}
.tips-row:hover .tips-copy-link { opacity: 1; }
.tips-copy-link:hover { color: var(--accent); background: var(--accent-dim2); }

/* Leere Kategorie */
.tips-empty {
  padding: 12px 16px 14px 56px;
  font-size: 13.5px;
  color: var(--text-3);
  font-style: italic;
}

/* --- Artikel-Inhalt --- */
.tips-body {
  display: none;
  padding: 4px 20px 26px 56px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.tips-node.open > .tips-body { display: block; animation: tips-fade .28s var(--ease-out); }

@keyframes tips-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.tips-body h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.2px;
  margin: 26px 0 10px;
}
.tips-body h4:first-child { margin-top: 18px; }
.tips-body p {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-2);
  margin: 0 0 14px;
}
.tips-body ul.tips-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}
.tips-body ul.tips-list li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-2);
  margin-bottom: 8px;
}
.tips-body ul.tips-list li::before {
  content: '';
  position: absolute;
  left: 4px; top: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Code-Block */
.tips-code {
  position: relative;
  margin: 0 0 18px;
  border-radius: var(--r-md);
  background: var(--dark);
  border: 1px solid rgba(255,255,255,.10);
  overflow: hidden;
}
.tips-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.tips-code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}
.tips-code-copy {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.14);
  transition: color var(--dur), background var(--dur), border-color var(--dur);
}
.tips-code-copy:hover { color: #fff; background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.28); }
.tips-code pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
}
.tips-code code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #e2e8f0;
  white-space: pre;
}

/* Befehls-Tabelle */
.tips-cmds {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 18px;
}
.tips-cmd {
  display: grid;
  grid-template-columns: minmax(150px, 260px) 1fr;
  gap: 6px 18px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.tips-cmd:hover { border-color: var(--accent-border); box-shadow: var(--shadow-xs); }
.tips-cmd-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-deep);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-sm);
  padding: 5px 9px;
  overflow-wrap: anywhere;
}
.tips-cmd-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-2);
}

/* Hinweis */
.tips-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 16px;
  margin: 0 0 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--accent-border);
  background: var(--accent-dim);
}
.tips-note-icon { font-size: 16px; line-height: 1.5; flex: 0 0 auto; }
.tips-note p { margin: 0; font-size: 14px; color: var(--text-2); }

/* Suche: Treffer-Hervorhebung */
.tips-hit { background: rgba(245, 158, 11, .30); border-radius: 3px; padding: 0 2px; }
.tips-node.tips-filtered { display: none; }

/* Deep-Link-Ziel kurz hervorheben */
.tips-node.tips-flash > .tips-row { animation: tips-flash 1.6s var(--ease); }
@keyframes tips-flash {
  0%, 100% { background: transparent; }
  20%      { background: var(--accent-dim2); }
}

/* --- Kachel auf der Startseite (index.html) --- */
.tutorials-grid .tut-card-tips { grid-column: span 2; }
.tut-card-tips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  background: linear-gradient(135deg, #14082a 0%, #4c1d95 50%, #1e1b4b 100%);
  border-color: rgba(168, 85, 247, 0.34);
  box-shadow: 0 8px 32px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.20);
  color: inherit;
}
.tut-card-tips:hover {
  background: linear-gradient(135deg, #1d0d3a 0%, #5b21b6 50%, #262263 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 4px 16px rgba(168,85,247,.26);
  border-color: rgba(168, 85, 247, 0.58);
  transform: translateY(-6px);
}
.tut-card-tips .tut-card-label    { color: #d8b4fe; }
.tut-card-tips .tut-card-title    { color: #fff; }
.tut-card-tips .tut-card-subtitle { color: #d8b4fe; }
.tut-card-tips .tut-card-desc     { color: rgba(255,255,255,.72); }
.tut-card-tips .btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  box-shadow: 0 8px 24px rgba(168,85,247,.38);
}
.tut-card-tips:hover .btn-primary {
  background: linear-gradient(135deg, #6d28d9 0%, #9333ea 100%);
  box-shadow: 0 12px 32px rgba(168,85,247,.55);
}

@media (max-width: 900px) {
  .tut-card-tips { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 700px) {
  .tips-body { padding-left: 20px; }
  .tips-empty { padding-left: 20px; }
  .tips-node-children { margin-left: 14px; }
  .tips-cmd { grid-template-columns: 1fr; }
  .tips-cmd-name { justify-self: start; }
  .tips-row { padding: 12px 12px; }
}
