/* MODULE: storage – Speicherübersicht & Versionsverlauf-Timeline
══════════════════════════════════════════════════════════════ */

/* ── Verbesserte Version-Items (Timeline) ────────────────── */
.version-item {
  display: block;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  position: relative;
}
.version-item:last-child { border-bottom: none; }
.version-item:hover { background: var(--bg-2); }

.version-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.version-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.version-item-dot.latest { background: var(--accent); }
.version-item-ts {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.version-item-badge-latest {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(255,107,0,0.1);
  border: 1px solid rgba(255,107,0,0.25);
  border-radius: 20px;
  padding: 2px 8px;
}
.version-item-summary {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 20px;
}
.version-item-changes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-left: 20px;
  margin-bottom: 10px;
}
.vi-change {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.vi-change.added    { background: rgba(22,163,74,0.08);   color: #16a34a; border-color: rgba(22,163,74,0.2); }
.vi-change.modified { background: rgba(59,130,246,0.08);  color: #3b82f6; border-color: rgba(59,130,246,0.2); }
.vi-change.initial  { background: rgba(107,114,128,0.08); color: #6b7280; border-color: rgba(107,114,128,0.2); }
.version-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 20px;
}

/* ── Storage Modal – Panel & Body ────────────────────────── */
.storage-panel { max-width: 640px !important; }
.storage-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* ── Tabs ────────────────────────────────────────────────── */
.storage-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 0 0 20px;
}
.storage-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}
.storage-tab:hover { color: var(--text); }
.storage-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.storage-tab-pane { display: none; }
.storage-tab-pane.active { display: block; }

/* ── GitHub-Repo Bereich ─────────────────────────────────── */
.storage-repo-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 6px;
}
.storage-stacked-bar {
  height: 20px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  margin-bottom: 8px;
}
.storage-stacked-seg { height: 100%; transition: width 0.5s ease; }
.storage-total-bar {
  background: var(--bg-3);
  border-radius: 8px;
  height: 12px;
  overflow: hidden;
  margin: 4px 0 6px;
}
.storage-total-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.6s ease;
  background: var(--accent);
}
.storage-total-fill.warning  { background: #f59e0b; }
.storage-total-fill.critical { background: #dc2626; }
.storage-total-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.storage-breakdown { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.storage-row {
  display: grid;
  grid-template-columns: 140px 1fr 64px 44px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.storage-row-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-weight: 500;
}
.storage-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.storage-bar-wrap { background: var(--bg-3); border-radius: 4px; height: 8px; overflow: hidden; }
.storage-bar-fill  { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.storage-size { font-size: 12px; color: var(--text-muted); text-align: right; white-space: nowrap; }
.storage-pct  { font-size: 12px; color: var(--text-muted); text-align: right; }

/* ── Divider & Abschnittskopf ────────────────────────────── */
.storage-divider { height: 1px; background: var(--border); margin: 18px 0; }
.storage-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── localStorage Bereich ────────────────────────────────── */
.storage-ls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}
.storage-ls-bar-wrap { background: var(--bg-3); border-radius: 4px; height: 6px; margin-top: 2px; overflow: hidden; }
.storage-ls-bar-fill { height: 100%; border-radius: 4px; background: #6b7280; }

/* ── Pi-Metriken ─────────────────────────────────────────── */
.pi-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}
.pi-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6b7280;
  flex-shrink: 0;
}
.pi-status-dot.online  { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.2); }
.pi-status-dot.stale   { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.pi-status-dot.offline { background: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,0.2); }

.pi-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.pi-metric-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.pi-metric-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.pi-metric-value {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}
.pi-metric-unit { font-size: 14px; opacity: 0.6; }
.pi-metric-bar-wrap { background: var(--bg-3); border-radius: 4px; height: 6px; overflow: hidden; }
.pi-metric-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  background: var(--accent);
}
.pi-metric-bar.ok       { background: #16a34a; }
.pi-metric-bar.warning  { background: #f59e0b; }
.pi-metric-bar.critical { background: #dc2626; }
.pi-metric-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.pi-temp-hot  { color: #dc2626; }
.pi-temp-warm { color: #f59e0b; }
.pi-temp-ok   { color: #16a34a; }

.pi-uptime-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Pi Setup-Anleitung ──────────────────────────────────── */
.pi-setup {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.pi-setup summary {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.pi-setup summary::-webkit-details-marker { display: none; }
.pi-setup summary::before { content: '▶ '; font-size: 10px; color: var(--text-muted); }
.pi-setup[open] summary::before { content: '▼ '; }
.pi-setup-body { padding: 0 16px 16px; }
.pi-setup-body p { font-size: 12px; color: var(--text-muted); margin: 0 0 8px; line-height: 1.6; }
.pi-setup-body pre {
  background: var(--bg-3);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 11px;
  line-height: 1.7;
  overflow-x: auto;
  margin: 6px 0 12px;
  color: var(--text);
}

/* ── Zustands-Texte ──────────────────────────────────────── */
.storage-error   { padding: 32px 24px; text-align: center; color: var(--text-muted); font-size: 14px; }
.storage-loading { padding: 32px 24px; text-align: center; color: var(--text-muted); font-size: 14px; }

@media (max-width: 520px) {
  .storage-row { grid-template-columns: 110px 1fr 52px 36px; font-size: 12px; }
  .pi-metrics-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pi-metric-value { font-size: 22px; }
}
