/* ═══════════════════════════════════════════════════════════════
   Settings Modal Styles
   ═══════════════════════════════════════════════════════════════ */

.settings-modal {
  max-width: 900px !important;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Tabs Bar */
.settings-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 20px 0;
  border-bottom: 1px solid var(--border, #2a2a3a);
  overflow-x: auto;
  flex-shrink: 0;
}

.settings-tab-btn {
  padding: 10px 16px;
  background: transparent;
  color: var(--text-muted, #999);
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.settings-tab-btn:hover {
  color: var(--text, #fff);
  background: var(--bg-hover, rgba(255,255,255,0.04));
}

.settings-tab-btn.active {
  color: var(--accent-primary, #4a9eff);
  border-bottom-color: var(--accent-primary, #4a9eff);
}

/* Body */
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.settings-tab-content {
  display: none;
}

.settings-tab-content.active {
  display: block;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.set-section {
  background: var(--bg-secondary, rgba(255,255,255,0.02));
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.set-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #fff);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, #2a2a3a);
}

.set-help {
  font-size: 11px;
  color: var(--text-muted, #999);
  line-height: 1.5;
}

.set-error {
  padding: 16px;
  background: rgba(245, 101, 101, 0.1);
  border: 1px solid rgba(245, 101, 101, 0.3);
  border-radius: 6px;
  color: #f56565;
  font-size: 13px;
}

/* Rows */
.set-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  flex-wrap: wrap;
}

.set-input-label {
  min-width: 200px;
  font-size: 13px;
  color: var(--text-muted, #ccc);
}

.set-input-with-help {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
}

/* Inputs */
.set-input,
.set-select {
  background: var(--bg-input, #0a0e1a);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text, #fff);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.set-input:focus,
.set-select:focus {
  border-color: var(--accent-primary, #4a9eff);
}

.set-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Slider */
.set-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.set-slider {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary, #25253a);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.set-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-primary, #4a9eff);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
}

.set-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-primary, #4a9eff);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
}

.set-slider-value {
  min-width: 50px;
  font-weight: 700;
  color: var(--accent-primary, #4a9eff);
  text-align: center;
  font-size: 14px;
}

/* Toggle Switch */
.set-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.set-toggle input[type="checkbox"] {
  display: none;
}

.set-toggle-slider {
  width: 44px;
  height: 24px;
  background: var(--bg-tertiary, #25253a);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}

.set-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  right: 3px;
  transition: transform 0.2s;
}

.set-toggle input[type="checkbox"]:checked ~ .set-toggle-slider {
  background: var(--accent-primary, #4a9eff);
}

.set-toggle input[type="checkbox"]:checked ~ .set-toggle-slider::before {
  transform: translateX(-20px);
}

.set-toggle-label {
  font-size: 13px;
  color: var(--text, #fff);
}

/* Tier Buttons */
.set-tier-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.set-tier-btn {
  padding: 6px 12px;
  background: var(--bg-secondary, #1a1a2a);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 6px;
  color: var(--text-muted, #999);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.2s;
}

.set-tier-btn:hover {
  background: var(--bg-hover, #252535);
  color: var(--text, #fff);
}

.set-tier-btn.active {
  background: var(--accent-primary, #4a9eff);
  color: white;
  border-color: var(--accent-primary, #4a9eff);
}

/* Checkboxes */
.set-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.set-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary, #1a1a2a);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.set-checkbox:hover {
  background: var(--bg-hover, #252535);
}

.set-checkbox input[type="checkbox"] {
  accent-color: var(--accent-primary, #4a9eff);
  width: 16px;
  height: 16px;
}

.set-checkbox-label {
  font-size: 13px;
  color: var(--text, #fff);
}

/* Radio Group */
.set-radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.set-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text, #fff);
}

.set-radio input[type="radio"] {
  accent-color: var(--accent-primary, #4a9eff);
}

/* Theme Cards */
.set-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.set-theme-card {
  background: var(--bg-secondary, #1a1a2a);
  border: 2px solid var(--border, #2a2a3a);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.set-theme-card:hover {
  border-color: var(--accent-primary, #4a9eff);
  transform: translateY(-2px);
}

.set-theme-card.active {
  border-color: var(--accent-primary, #4a9eff);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.set-theme-preview {
  height: 60px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.dark-preview {
  background: linear-gradient(135deg, #0a0e1a 0%, #1a1a2a 100%);
}

.light-preview {
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
  border: 1px solid #ddd;
}

.auto-preview {
  background: linear-gradient(135deg, #0a0e1a 0%, #ffffff 100%);
}

.set-theme-name {
  font-size: 13px;
  color: var(--text, #fff);
  font-weight: 500;
}

/* Symbols */
.set-symbols-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.set-symbol-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-secondary, #1a1a2a);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #fff);
}

.set-symbol-remove {
  background: rgba(245, 101, 101, 0.15);
  border: none;
  color: #f56565;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s;
}

.set-symbol-remove:hover {
  background: #f56565;
  color: white;
}

/* Info Cards */
.set-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.set-info-card {
  background: var(--bg-secondary, #1a1a2a);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 6px;
  padding: 12px;
}

.set-info-label {
  font-size: 11px;
  color: var(--text-muted, #999);
  margin-bottom: 4px;
}

.set-info-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #fff);
}

.set-info-value.good {
  color: #48bb78;
}

.set-info-value.warning {
  color: #ed8936;
}

/* Links */
.set-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.set-link {
  display: inline-block;
  padding: 8px 12px;
  background: var(--bg-secondary, #1a1a2a);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 6px;
  color: var(--accent-primary, #4a9eff);
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s;
}

.set-link:hover {
  background: var(--bg-hover, #252535);
  border-color: var(--accent-primary, #4a9eff);
}

/* Buttons */
.set-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 16px;
}

.set-btn {
  padding: 8px 16px;
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.set-btn-primary {
  background: var(--accent-primary, #4a9eff);
  color: white;
  border-color: var(--accent-primary, #4a9eff);
}

.set-btn-primary:hover {
  background: var(--accent-primary-hover, #3a8eef);
  transform: translateY(-1px);
}

.set-btn-secondary {
  background: var(--bg-secondary, #1a1a2a);
  color: var(--text, #fff);
}

.set-btn-secondary:hover {
  background: var(--bg-hover, #252535);
}

.set-btn-danger {
  background: rgba(245, 101, 101, 0.15);
  color: #f56565;
  border-color: rgba(245, 101, 101, 0.3);
}

.set-btn-danger:hover {
  background: #f56565;
  color: white;
  border-color: #f56565;
}

/* Toast */
.set-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s;
  z-index: 10001;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.set-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.set-toast-success {
  background: #48bb78;
  color: white;
}

.set-toast-error {
  background: #f56565;
  color: white;
}

.set-toast-info {
  background: var(--accent-primary, #4a9eff);
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .settings-modal {
    max-width: 100% !important;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .set-input-label {
    min-width: 100%;
  }
  
  .set-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .settings-tab-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Symbol Search Autocomplete (in Settings)
   ═══════════════════════════════════════════════════════════════ */

.set-search-wrapper {
  position: relative;
  width: 100%;
}

.set-search-input {
  width: 100%;
  padding-left: 32px !important;
  position: relative;
}

.set-search-spinner {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid var(--border, #2a2a3a);
  border-top-color: var(--accent-primary, #4a9eff);
  border-radius: 50%;
  animation: set-spin 0.6s linear infinite;
  display: none;
  pointer-events: none;
}

.set-search-spinner.show {
  display: block;
}

@keyframes set-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

.set-search-results {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin-top: 4px;
  background: var(--bg-card-solid, #161827);
  border: 1px solid var(--border-strong, #2a2a3a);
  border-radius: 8px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
}

.set-search-results.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.set-search-empty {
  padding: 16px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted, #999);
}

.set-search-empty strong {
  color: var(--gold, #ffd700);
}

.set-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.05));
  cursor: pointer;
  transition: background 0.15s;
}

.set-search-item:last-child {
  border-bottom: none;
}

.set-search-item:hover,
.set-search-item.selected {
  background: var(--bg-hover, rgba(74, 158, 255, 0.08));
}

.set-search-item.is-active {
  cursor: default;
  opacity: 0.6;
}

.set-search-item.is-active:hover {
  background: transparent;
}

.set-search-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.set-search-item-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text, #fff);
}

.set-search-item-desc {
  font-size: 11px;
  color: var(--text-muted, #999);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.set-search-tag {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.set-search-tag.add {
  background: rgba(74, 158, 255, 0.15);
  color: var(--accent-primary, #4a9eff);
  border: 1px solid rgba(74, 158, 255, 0.3);
}

.set-search-item:not(.is-active):hover .set-search-tag.add {
  background: var(--accent-primary, #4a9eff);
  color: white;
}

.set-search-tag.active {
  background: rgba(72, 187, 120, 0.15);
  color: #48bb78;
  border: 1px solid rgba(72, 187, 120, 0.3);
}
