.settings-container {
  padding: 2rem;
  min-height: 100vh;
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.settings-container::-webkit-scrollbar {
  display: none;
}

:root.dark .settings-container,
:root.auto.dark .settings-container {
  background: var(--color-background-primary);
}

:root.dark .settings-header,
:root.dark .tab-navigation,
:root.dark .settings-section,
:root.dark .form-input,
:root.dark .form-select,
:root.auto.dark .settings-header,
:root.auto.dark .tab-navigation,
:root.auto.dark .settings-section,
:root.auto.dark .form-input,
:root.auto.dark .form-select {
  background: var(--color-background-tertiary);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

:root.dark .btn,
:root.auto.dark .btn {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

:root.dark .btn:hover,
:root.auto.dark .btn:hover {
  background: var(--color-surface-elevated);
}

:root.dark .btn-primary,
:root.auto.dark .btn-primary {
  background: var(--color-accent);
  color: white;
}

:root.dark .btn-primary:hover,
:root.auto.dark .btn-primary:hover {
  background: var(--color-accent-hover);
}

/* Header */
.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

:root.dark .settings-header,
:root.auto.dark .settings-header {
  background: var(--color-background-tertiary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-icon {
  color: var(--color-accent);
}

.settings-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

:root.dark .settings-header h1,
:root.auto.dark .settings-header h1 {
  color: var(--color-text-primary);
}

.settings-header p {
  margin: 0;
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
}

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

.btn-primary {
  background: var(--color-accent);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.btn-secondary {
  background: var(--color-background-tertiary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-background-secondary);
}

/* Message Banner */
.message-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.message-banner.success {
  background: rgba(52, 199, 89, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(52, 199, 89, 0.3);
}

.message-banner.error {
  background: rgba(255, 59, 48, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(255, 59, 48, 0.3);
}

.message-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: currentColor;
  margin-left: auto;
  opacity: 0.7;
}

.message-close:hover {
  opacity: 1;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 0.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

:root.dark .tab-navigation,
:root.auto.dark .tab-navigation {
  background: var(--color-background-tertiary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  border-radius: 8px;
  color: var(--color-text-tertiary);
  font-weight: 500;
  cursor: pointer;
  flex: 1;
  justify-content: center;
}

.tab-button:hover {
  background: var(--color-background-tertiary);
  color: var(--color-text-primary);
}

.tab-button.active {
  background: var(--color-accent);
  color: white;
}

/* Content */
.settings-content {
  background: var(--color-surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-height: fit-content;
}

:root.dark .settings-content,
:root.auto.dark .settings-content {
  background: var(--color-background-tertiary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.tab-content {
  padding: 2rem;
  min-height: fit-content;
}

.settings-section {
  margin-bottom: 2.5rem;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

:root.dark .settings-section h2,
:root.auto.dark .settings-section h2 {
  color: var(--color-text-primary);
}

.settings-section p {
  margin: 0 0 1.5rem 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* Form Elements */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

:root.dark .form-group label,
:root.auto.dark .form-group label {
  color: var(--color-text-primary);
}

.form-input {
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--color-surface);
  color: var(--color-text-primary);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--color-surface);
  color: var(--color-text-primary);
  resize: vertical;
  min-height: 200px;
  font-family: 'Fira Code', 'Courier New', monospace;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

:root.dark .form-input,
:root.auto.dark .form-input {
  background: var(--color-background-tertiary);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

:root.dark .form-input:focus,
:root.auto.dark .form-input:focus {
  border-color: var(--color-accent);
}

:root.dark .form-textarea,
:root.auto.dark .form-textarea {
  background: var(--color-background-tertiary);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

:root.dark .form-textarea:focus,
:root.auto.dark .form-textarea:focus {
  border-color: var(--color-accent);
}

.form-group small {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

/* Input Groups */
.input-group {
  display: flex;
}

.input-group .form-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
  flex: 1;
}

.input-addon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  border: 1px solid var(--color-border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  background: var(--color-background-tertiary);
  color: var(--color-text-tertiary);
  cursor: pointer;
}

.input-addon-btn:hover {
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
}

.input-addon-btn.reset-password-btn {
  background: var(--color-error-background, #fef2f2);
  color: var(--color-error, #dc2626);
  border-color: var(--color-error-border, #fecaca);
}

.input-addon-btn.reset-password-btn:hover:not(:disabled) {
  background: var(--color-error, #dc2626);
  color: white;
}

.input-addon-btn.reset-password-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Switch */
.switch-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 1rem;
  border: 1px solid var(--color-border-secondary);
  border-radius: 8px;
  background: var(--color-background-tertiary);
  min-height: auto;
}

.switch-label:hover {
  background: var(--color-background-secondary);
  border-color: var(--color-border);
}

:root.dark .switch-label,
:root.auto.dark .switch-label {
  background: var(--color-background-tertiary);
  border-color: var(--color-border);
}

:root.dark .switch-label:hover,
:root.auto.dark .switch-label:hover {
  background: var(--color-background-secondary);
  border-color: var(--color-border);
}

.switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--color-border);
  border-radius: 12px;
  flex-shrink: 0;
}

.switch-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--color-surface);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.switch-input:checked + .switch-slider {
  background: var(--color-accent);
}

.switch-input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.switch-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
}

.switch-title {
  font-weight: 500;
  color: var(--color-text-primary);
  font-size: 0.875rem;
  line-height: 1.25;
}

.switch-description {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  line-height: 1.25;
}

:root.dark .switch-title,
:root.auto.dark .switch-title {
  color: var(--color-text-primary);
}

:root.dark .switch-description,
:root.auto.dark .switch-description {
  color: var(--color-text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .settings-container {
    padding: 1rem;
  }

  .settings-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .tab-navigation {
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
  .tab-content {
    padding: 1.5rem;
  }
}
