/* Settings Page - custom components only */

.settings-page {
  padding: var(--spacing-lg);
  max-width: 800px;
  margin: 0 auto;
}

/* Tabs */
.settings-tabs-wrapper {
  position: relative;
  margin-bottom: var(--spacing-xl);
  padding: 0 0.8rem;
}

.settings-tabs {
  display: flex;
  gap: 0rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-bottom: 2px solid var(--color-border-light);
  touch-action: pan-x; /* Lock Y-axis, allow only horizontal scrolling */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.settings-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

.settings-tab {
  flex: 0 0 max-content;
  white-space: nowrap;
  width: max-content;
  padding: 0rem 1.4rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -2px;
}

.settings-tabs-arrow {
  position: absolute;
  top: calc(50% - 0.2rem);
  transform: translateY(-50%);
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--color-primary);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.2s ease;
}

.settings-tabs-arrow.visible {
  opacity: 1;
}

.settings-tabs-arrow-left {
  left: -1.6rem;
}

.settings-tabs-arrow-right {
  right: -1.6rem;
}

.settings-tab:hover {
  color: var(--color-primary);
  background: var(--color-bg-hover);
}

.settings-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Content */
.settings-content {
  min-height: 400px;
}

.settings-section {
  animation: fadeIn 0.2s ease-in;
}

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

.settings-group {
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
  border-bottom: 1px solid var(--color-border-light);
}

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

.settings-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  cursor: pointer;
}

.settings-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.settings-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: var(--spacing-sm) 0 0;
  line-height: 1.5;
}

/* Theme Buttons */
.settings-theme-options {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.settings-theme-btn {
  flex: 1;
  padding: var(--spacing-md);
  border: 2px solid var(--color-border-light);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-theme-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.settings-theme-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-white);
}

/* Range Slider */
.settings-range {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-gray-300);
  outline: none;
  margin-top: var(--spacing-sm);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.settings-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.settings-range::-webkit-slider-thumb:hover {
  background: var(--color-primary-hover);
  transform: scale(1.1);
}

.settings-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.settings-range::-moz-range-thumb:hover {
  background: var(--color-primary-hover);
  transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
  .settings-page {
    padding: var(--spacing-md);
  }

  .settings-tabs {
    padding: 0 0.1rem;
  }

  .settings-tab {
    padding: 0.4rem 0.35rem;
  }

  .settings-tabs-wrapper {
    padding: 0 0.55rem;
  }

  .settings-tabs-arrow {
    top: calc(50% - 0.15rem);
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.65rem;
  }

  .settings-tabs-arrow-left {
    left: -1.2rem;
  }

  .settings-tabs-arrow-right {
    right: -1.2rem;
  }

  .settings-theme-options {
    flex-direction: column;
  }
}

/* Account Management */
.account-form {
  margin-bottom: var(--spacing-xl);
}

.account-message {
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
  font-weight: 500;
}

.account-message.success {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.account-message.error {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}
