/* Atlas Settings Panel — Full settings drawer (Build 403) */

/* ═══ PANEL CONTAINER ═══ */

#atlas-settings-panel {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: none;
}
#atlas-settings-panel.asp-open { pointer-events: auto; }
#atlas-settings-panel.asp-closed { pointer-events: none; }

/* ═══ BACKDROP ═══ */

.asp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.asp-open .asp-backdrop { opacity: 1; }
.asp-closed .asp-backdrop { opacity: 0; }

/* ═══ DRAWER ═══ */

.asp-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 92vw;
  height: 100%;
  background: rgba(10, 10, 14, 0.98);
  border-left: 1px solid rgba(var(--accent-rgb, 212,175,55), 0.12);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
}
.asp-open .asp-drawer { transform: translateX(0); }
.asp-closed .asp-drawer { transform: translateX(100%); }

/* ═══ HEADER ═══ */

.asp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.asp-title {
  font-family: 'Consolas', 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: var(--accent, #d4af37);
}

.asp-close {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #888;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.asp-close:hover { border-color: rgba(255,255,255,0.25); color: #ccc; }

/* ═══ BODY ═══ */

.asp-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px 20px;
}

/* ═══ SECTIONS ═══ */

.asp-section {
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.asp-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
  -webkit-user-select: none;
}
.asp-section-head:hover { background: rgba(255, 255, 255, 0.03); }

.asp-section-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
  color: var(--accent, #d4af37);
}

.asp-section-label {
  font-family: 'Consolas', 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.6);
  flex: 1;
}

.asp-section-arrow {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  transition: transform 0.2s;
}

.asp-section-content {
  padding: 4px 16px 16px;
  transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
  max-height: 600px;
  opacity: 1;
  overflow: hidden;
}
.asp-section-content.asp-collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* ═══ SUB-LABELS ═══ */

.asp-sub-label {
  font-family: 'Consolas', 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* ═══ THEME CARDS (reuse theme-settings.css patterns) ═══ */

.asp-themes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.asp-theme-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
  text-align: left;
  overflow: hidden;
  color: inherit;
  font-family: inherit;
}
.asp-theme-card:hover { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.05); }
.asp-theme-card.asp-active {
  border-color: var(--accent, #d4af37);
  box-shadow: 0 0 0 1px var(--accent, #d4af37), 0 4px 20px rgba(var(--accent-rgb, 212,175,55), 0.1);
}

.asp-preview {
  height: 48px;
  border-radius: 9px 9px 0 0;
  position: relative;
  overflow: hidden;
}
.asp-preview-bar {
  position: absolute; top: 7px; left: 10px; width: 40%; height: 3px; border-radius: 2px; opacity: 0.8;
}
.asp-preview-panel {
  position: absolute; bottom: 5px; left: 10px; width: 35%; height: 16px; border-radius: 3px;
}
.asp-preview-panel2 { left: auto; right: 10px; width: 45%; }

.asp-card-info {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 2px;
}
.asp-card-name {
  font-family: 'Consolas', 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.1em; color: #e0e0e0;
}
.asp-card-effects { font-size: 7px; letter-spacing: 2px; }
.asp-card-desc { padding: 0 12px 10px; font-size: 10px; line-height: 1.5; color: rgba(255,255,255,0.35); }

/* ═══ ACCENT COLOR ═══ */

.asp-accents { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

.asp-accent-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1); cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.asp-accent-btn:hover { transform: scale(1.1); border-color: rgba(255,255,255,0.3); }
.asp-accent-btn.asp-accent-active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.2); }
.asp-accent-btn.asp-accent-active::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.asp-custom-color { display: flex; align-items: center; gap: 10px; }
.asp-color-label { font-size: 11px; color: rgba(255,255,255,0.4); }
#asp-color-picker {
  width: 34px; height: 26px; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; background: transparent; cursor: pointer; padding: 0;
}
#asp-color-picker::-webkit-color-swatch-wrapper { padding: 2px; }
#asp-color-picker::-webkit-color-swatch { border: none; border-radius: 2px; }

/* ═══ VOICE SETTINGS (rows, switches, sliders) ═══ */

.asp-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; gap: 10px;
}
.asp-row > label:first-child {
  font-size: 12px; color: rgba(255,255,255,0.6); flex-shrink: 0;
}

.asp-switch {
  position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0;
}
.asp-switch input { opacity: 0; width: 0; height: 0; }
.asp-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: rgba(255,255,255,0.1); border-radius: 11px;
  transition: background 0.3s;
}
.asp-slider::before {
  content: ''; position: absolute; left: 3px; bottom: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #888; transition: transform 0.3s, background 0.3s;
}
.asp-switch input:checked + .asp-slider { background: rgba(var(--accent-rgb,212,175,55), 0.3); }
.asp-switch input:checked + .asp-slider::before {
  transform: translateX(18px); background: var(--accent, #d4af37);
}

.asp-inp {
  width: 140px; padding: 5px 10px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px; color: #e0e0e0; font-size: 12px;
  font-family: system-ui, -apple-system, sans-serif; outline: none;
  transition: border-color 0.2s;
}
.asp-inp:focus { border-color: rgba(var(--accent-rgb,212,175,55), 0.4); }

.asp-sl-wrap { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 180px; }
.asp-sl {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; outline: none;
}
.asp-sl::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent, #d4af37); cursor: pointer;
  box-shadow: 0 0 6px rgba(var(--accent-rgb,212,175,55), 0.3);
}
.asp-sl::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; border: none;
  background: var(--accent, #d4af37); cursor: pointer;
}
.asp-sl-val {
  font-family: 'Consolas', 'JetBrains Mono', monospace;
  font-size: 11px; color: rgba(255,255,255,0.5); min-width: 30px; text-align: right;
}

.asp-hint {
  font-size: 10px; color: rgba(255,255,255,0.25); margin-top: 8px; line-height: 1.5;
}

/* ═══ KONTO SECTION ═══ */

.asp-konto-info { margin-bottom: 14px; }

.asp-konto-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.asp-konto-row:last-child { border-bottom: none; }

.asp-konto-key {
  font-family: 'Consolas', 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.15em; color: rgba(255,255,255,0.35);
}
.asp-konto-val {
  font-size: 12px; color: rgba(255,255,255,0.7); text-align: right;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.asp-role-badge {
  font-family: 'Consolas', 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.1em; padding: 2px 8px;
  border-radius: 4px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.asp-role-badge[data-role="owner"] {
  color: #d4af37; border-color: rgba(212,175,55,0.25); background: rgba(212,175,55,0.08);
}
.asp-role-badge[data-role="admin"] {
  color: #6366f1; border-color: rgba(99,102,241,0.25); background: rgba(99,102,241,0.08);
}

.asp-logout-btn {
  width: 100%; padding: 10px;
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
  border-radius: 6px; color: #ef4444;
  font-family: 'Consolas', 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.2em; cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.asp-logout-btn:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.35); }

/* ═══ SYSTEM LINKS ═══ */

.asp-sys-links {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.asp-sys-link {
  display: inline-block; padding: 6px 14px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px; color: rgba(255,255,255,0.5); font-size: 11px;
  text-decoration: none; transition: border-color 0.2s, color 0.2s;
}
.asp-sys-link:hover { border-color: rgba(var(--accent-rgb,212,175,55), 0.3); color: var(--accent, #d4af37); }

/* ═══ GEAR BUTTON STYLES ═══ */

#atlas-settings-gear {
  background: transparent;
  border: 1.5px solid var(--accent, #d4af37);
  color: var(--accent, #d4af37);
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.2s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
#atlas-settings-gear:hover { background: rgba(var(--accent-rgb,212,175,55), 0.15); }

#atlas-settings-gear svg { display: block; }

/* ═══ MOBILE ═══ */

@media (max-width: 768px) {
  .asp-drawer { width: 100%; max-width: 100vw; }
  .asp-body { padding: 10px 14px 14px; }
  .asp-inp { width: 120px; }
}
