/* ========================================================================== */
/* Settings — Apple Futuristic                                                 */
/* ========================================================================== */

.settings-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4) !important;
  backdrop-filter: blur(8px) !important;
  z-index: 100;
  animation: fadeInBackdrop 0.2s ease !important;
}
.settings-backdrop-exit { animation: fadeOutBackdrop 0.2s ease forwards !important; }

.settings-panel {
  position: fixed; top: 0; right: 0;
  width: 480px; max-width: 100vw; height: 100vh;
  background: var(--bg-secondary) !important;
  border-left: 1px solid var(--border) !important;
  box-shadow: var(--shadow-lg) !important;
  z-index: 101;
  display: flex; flex-direction: column; overflow: hidden;
  animation: slideInRight 0.25s cubic-bezier(0.16,1,0.3,1) !important;
}
.settings-panel::before { display: none !important; }
.settings-panel-exit { animation: slideOutRight 0.2s ease forwards !important; }

.settings-close-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm) !important;
  border: none !important;
  background: var(--bg-hover) !important;
  color: var(--text-tertiary) !important;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s !important; font-size: 16px !important;
}
.settings-close-btn:hover { background: var(--bg-active) !important; color: var(--text-primary) !important; }

.settings-tab-bar {
  display: flex; gap: 0;
  padding: 0 24px !important;
  border-bottom: 1px solid var(--border) !important;
}
.settings-tab-bar::after { display: none !important; }
.settings-tab {
  padding: 10px 16px !important; font-size: 13px !important;
  color: var(--text-tertiary) !important;
  cursor: pointer; border: none !important; background: transparent !important;
  border-bottom: 2px solid transparent !important;
  transition: all 0.15s !important; font-family: inherit;
}
.settings-tab:hover { color: var(--text-secondary) !important; }
.settings-tab-active { color: var(--accent) !important; border-bottom-color: var(--accent) !important; }

.settings-search-wrap { margin: 14px 24px !important; }
.settings-input {
  width: 100% !important; padding: 8px 12px !important;
  background: var(--bg-base) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-primary) !important; font-size: 13px !important;
  outline: none !important; transition: border-color 0.15s !important;
}
.settings-input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(10,132,255,0.1) !important; }
.settings-input::placeholder { color: var(--text-placeholder) !important; }

.settings-content {
  flex: 1; overflow-y: auto;
  padding: 16px 24px 24px !important;
  background: transparent !important;
}
.settings-content h3, .settings-content .section-title {
  font-size: 11px !important; font-weight: 600 !important;
  text-transform: uppercase !important; letter-spacing: 0.06em !important;
  color: var(--text-tertiary) !important;
  margin-bottom: 12px !important; padding-bottom: 6px !important;
  border-bottom: 1px solid var(--border) !important;
}

.settings-content label { color: var(--text-secondary) !important; font-size: 13px !important; }
.settings-content input[type="text"],
.settings-content input[type="number"],
.settings-content input[type="password"],
.settings-content select,
.settings-content textarea {
  background: var(--bg-base) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  color: var(--text-primary) !important; font-size: 13px !important;
  padding: 8px 12px !important;
  outline: none !important; transition: border-color 0.2s, box-shadow 0.2s !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.settings-content select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  padding-right: 30px !important;
}
.settings-content input:focus,
.settings-content select:focus,
.settings-content textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(10,132,255,0.1) !important;
}
.settings-content .toggle, .settings-content input[type="checkbox"] { accent-color: var(--accent) !important; }
.settings-content button[type="submit"],
.settings-content .btn-primary,
.settings-content .save-btn {
  background: linear-gradient(180deg, #5bb8ff 0%, #0055b3 100%) !important; color: #fff !important;
  border: none !important; border-radius: var(--radius-md) !important;
  font-weight: 500 !important; letter-spacing: -0.01em !important;
  box-shadow: 0 2px 8px rgba(0,85,179,0.25) !important;
  transition: all 0.2s ease !important;
}
.settings-content button[type="submit"]:hover,
.settings-content .btn-primary:hover,
.settings-content .save-btn:hover { box-shadow: 0 4px 16px rgba(0,85,179,0.35) !important; transform: translateY(-1px) !important; }

.settings-panel h2, .settings-panel .panel-title {
  font-size: 17px !important; font-weight: 600 !important;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: unset !important; background: none !important;
}

@media (max-width: 768px) { .settings-panel { width: 100vw !important; } }

/* ═══ Settings Utility Classes — Theme-Aware ═══ */
.settings-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.settings-value {
  font-size: 14px;
  color: var(--text-primary);
}
.settings-value-mono {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}
.settings-muted {
  font-size: 11px;
  color: var(--text-secondary);
}
.settings-loading {
  text-align: center;
  padding: 24px 0;
  color: var(--text-tertiary);
  font-size: 14px;
}
.settings-error {
  font-size: 12px;
  color: var(--xbot-color-error, #dc2626);
  margin-top: 4px;
  margin-bottom: 8px;
}
.settings-divider {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.settings-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-base);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}
.settings-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}
.settings-action-danger {
  color: var(--xbot-color-error, #dc2626);
  border-color: rgba(220, 38, 38, 0.3);
}
.settings-action-danger:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: var(--xbot-color-error, #dc2626);
}
.settings-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}
.settings-badge-active {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.settings-badge-inactive {
  background: var(--bg-base);
  color: var(--text-tertiary);
}
[data-theme="light"] .settings-badge-active {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}
.settings-session-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: var(--bg-base);
  margin-bottom: 12px;
}
.settings-session-item {
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-base);
  border-left: 3px solid var(--accent);
  margin-right: 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.settings-session-item:hover {
  background: var(--bg-hover);
}
.settings-list-item {
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-base);
  cursor: pointer;
  transition: background 0.15s;
}
.settings-list-item:hover {
  background: var(--bg-hover);
}
