/* Settings Panel Styles */

.settings-gear-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--bg-card, #2a2a3e);
  color: white;
  font-size: 24px;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.3s ease, background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-gear-btn:hover {
  transform: rotate(90deg) scale(1.1);
  background: var(--accent, #6366f1);
}

/* Panel */
.settings-panel {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.settings-panel.open {
  display: flex;
}

.settings-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.settings-drawer {
  position: absolute;
  right: 0;
  top: 0;
  width: 380px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-body, #1a1a2e);
  color: var(--text-primary, #e2e8f0);
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #333);
  position: sticky;
  top: 0;
  background: var(--bg-body, #1a1a2e);
  z-index: 1;
}

.settings-header h2 {
  margin: 0;
  font-size: 18px;
}

.settings-close {
  background: none;
  border: none;
  color: var(--text-secondary, #94a3b8);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.settings-close:hover {
  background: var(--bg-hover, #333);
  color: var(--text-primary, #e2e8f0);
}

.settings-body {
  padding: 12px 20px 80px;
}

/* Sections */
.settings-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border, #2a2a3e);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary, #94a3b8);
}

.settings-hint {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  margin: 0 0 10px;
}

/* Toggle labels */
.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 14px;
}

.settings-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent, #6366f1);
  cursor: pointer;
  flex-shrink: 0;
}

/* Select */
.settings-section select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border, #333);
  background: var(--bg-card, #2a2a3e);
  color: var(--text-primary, #e2e8f0);
  font-size: 14px;
  cursor: pointer;
}

/* Rows */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  gap: 12px;
}

.settings-row label {
  font-size: 14px;
  white-space: nowrap;
}

.settings-row select {
  width: auto;
  min-width: 120px;
}

/* Color rows */
.settings-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.agent-name-label {
  font-size: 14px;
  font-weight: 500;
}

.settings-color-row input[type="color"] {
  width: 36px;
  height: 28px;
  border: 1px solid var(--border, #333);
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

/* Nickname rows */
.settings-nickname-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  gap: 12px;
}

.settings-nickname-row input[type="text"] {
  width: 140px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #333);
  background: var(--bg-card, #2a2a3e);
  color: var(--text-primary, #e2e8f0);
  font-size: 13px;
}

/* Action buttons */
.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.settings-btn {
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid var(--border, #333);
  background: var(--bg-card, #2a2a3e);
  color: var(--text-primary, #e2e8f0);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: center;
}

.settings-btn:hover {
  background: var(--bg-hover, #363651);
}

.settings-btn-reset {
  border-color: #ef4444;
  color: #ef4444;
}

.settings-btn-reset:hover {
  background: rgba(239, 68, 68, 0.15);
}

.settings-btn-export {
  border-color: #22c55e;
  color: #22c55e;
}

.settings-btn-export:hover {
  background: rgba(34, 197, 94, 0.15);
}

/* Display mode classes */
body.compact-mode .settings-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
}

body.no-animations * {
  animation-duration: 0s !important;
  transition-duration: 0s !important;
}

body.hide-timestamps .timestamp {
  display: none;
}

/* Light mode overrides */
body.light-mode .settings-drawer {
  background: #f8fafc;
  color: #1e293b;
}

body.light-mode .settings-section select,
body.light-mode .settings-nickname-row input,
body.light-mode .settings-btn {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #1e293b;
}

body.light-mode .settings-close:hover {
  background: #f1f5f9;
}

body.light-mode .settings-gear-btn {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

body.light-mode .settings-overlay {
  background: rgba(0, 0, 0, 0.3);
}

/* Mobile */
@media (max-width: 768px) {
  .settings-drawer {
    width: 100%;
    max-width: 100vw;
  }

  .settings-gear-btn {
    bottom: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .settings-body {
    padding: 12px 16px 100px;
  }

  .settings-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-row select {
    width: 100%;
  }
}
