/* ═══════════════════════════════════════════════════
   SETTINGS PAGE — Premium Neumorphic Layout
   ═══════════════════════════════════════════════════ */

.settings-page {
  padding: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

/* ─── Section ─── */
.settings-section {
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08), 0 5px 15px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.settings-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.12), 0 8px 20px rgba(16, 185, 129, 0.08);
}

[data-theme="dark"] .settings-section {
  background: var(--dash-card-bg, #1a202c);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 5px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .settings-section:hover {
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.2), 0 8px 20px rgba(16, 185, 129, 0.15);
}

.settings-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.05), transparent 60%);
  pointer-events: none;
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 2px solid rgba(0, 0, 0, 0.03);
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .settings-section-header {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.settings-section-header h3 {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--vibrant-green);
  margin: 0;
}

.settings-section-icon {
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(16, 185, 129, 0.15);
  color: var(--vibrant-green);
}

[data-theme="dark"] .settings-section-header h3 {
  color: #fff;
}

[data-theme="dark"] .settings-section-icon {
  background: #2d3748;
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* ─── Settings Group ─── */
.settings-group {
  padding: 0.5rem 0;
  position: relative;
  z-index: 1;
}

/* ─── Settings Row (Toggle Items) ─── */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  transition: background 0.3s ease;
  gap: 1rem;
}

.settings-row:hover {
  background: rgba(16, 185, 129, 0.04);
}

[data-theme="dark"] .settings-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.settings-row-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.settings-row-icon {
  font-size: 1.4rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  color: #475569;
}

[data-theme="dark"] .settings-row-icon {
  background: #2d3748;
  border-color: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.settings-row-title {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.3;
}

.settings-row-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.4;
}

/* ─── Toggle Switch ─── */
.settings-toggle {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 32px;
  flex-shrink: 0;
}

.settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  margin: 0 !important;
}

.settings-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #e2e8f0;
  border-radius: 32px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .settings-toggle-slider {
  background: #4a5568;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.settings-toggle-slider::before {
  content: "";
  position: absolute;
  height: 24px;
  width: 24px;
  right: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.settings-toggle input:checked+.settings-toggle-slider {
  background: var(--vibrant-green);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.settings-toggle input:checked+.settings-toggle-slider::before {
  transform: translateX(-24px);
}

.settings-toggle input:focus+.settings-toggle-slider {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

/* ─── Select Dropdown ─── */
.settings-select {
  min-width: 140px;
  width: auto !important;
  padding: 0.6rem 1.2rem !important;
  border-radius: 99px !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  background: #f8fafc !important;
  color: var(--text-primary) !important;
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 0.95rem !important;
  cursor: pointer;
  height: auto !important;
  margin: 0 !important;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .settings-select {
  background: #2d3748 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.settings-select:hover {
  border-color: var(--vibrant-green) !important;
  background: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .settings-select:hover {
  background: #4a5568 !important;
  box-shadow: 0 8px 15px rgba(16, 185, 129, 0.2);
}

.settings-select:focus {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

/* ─── Form Block (Account Settings) ─── */
.settings-form-block {
  padding: 1.5rem;
}

.settings-form-title {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.settings-input-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.settings-input-row input,
.settings-form-block input {
  flex: 1;
  margin: 0 !important;
  padding: 0.8rem 1.2rem;
  border-radius: 16px;
  border: 2px solid rgba(0, 0, 0, 0.05);
  background: #f8fafc;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: all 0.3s ease;
  width: 100%;
}

[data-theme="dark"] .settings-input-row input,
[data-theme="dark"] .settings-form-block input {
  background: #2d3748;
  border-color: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.settings-input-row input:focus,
.settings-form-block input:focus {
  border-color: var(--vibrant-green);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
  outline: none;
}

[data-theme="dark"] .settings-input-row input:focus,
[data-theme="dark"] .settings-form-block input:focus {
  background: #1a202c;
}

.settings-divider {
  height: 2px;
  background: rgba(0, 0, 0, 0.03);
  margin: 0 1.5rem;
}

[data-theme="dark"] .settings-divider {
  background: rgba(255, 255, 255, 0.05);
}

/* ─── Danger Zone ─── */
.settings-danger-zone {
  border-color: rgba(231, 76, 60, 0.3) !important;
}

.settings-danger-zone:hover {
  box-shadow: 0 20px 40px rgba(231, 76, 60, 0.15), 0 8px 20px rgba(231, 76, 60, 0.1) !important;
  border-color: rgba(231, 76, 60, 0.6) !important;
}

.settings-danger-zone .settings-section-header {
  border-bottom-color: rgba(231, 76, 60, 0.1);
}

.settings-danger-zone .settings-section-header h3 {
  color: var(--danger);
  margin: 0;
}

.settings-danger-zone .settings-section-icon {
  background: #fff;
  border-color: rgba(231, 76, 60, 0.2);
  color: var(--danger);
  box-shadow: 0 8px 16px rgba(231, 76, 60, 0.15);
}

[data-theme="dark"] .settings-danger-zone .settings-section-icon {
  background: #2d3748;
  border-color: rgba(231, 76, 60, 0.4);
}

/* ─── Feedback Messages ─── */
.settings-feedback {
  padding: 1.2rem 1.5rem;
  border-radius: 16px;
  font-weight: 800;
  text-align: center;
  animation: settingsFadeIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-top: 1.5rem;
  grid-column: 1 / -1;
  /* spans across grid */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.settings-feedback-success {
  background: #f0fdf4;
  color: var(--vibrant-green);
  border: 2px solid rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .settings-feedback-success {
  background: rgba(16, 185, 129, 0.1);
}

.settings-feedback-error {
  background: #fef2f2;
  color: var(--danger);
  border: 2px solid rgba(231, 76, 60, 0.4);
}

[data-theme="dark"] .settings-feedback-error {
  background: rgba(231, 76, 60, 0.1);
}

@keyframes settingsFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .settings-page {
    padding: 1rem;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .settings-section {
    border-radius: 20px;
  }

  .settings-row {
    padding: 1rem;
    flex-wrap: wrap;
    /* allow wrapping on very small screens */
  }

  .settings-form-block {
    padding: 1rem;
  }

  .settings-input-row {
    flex-direction: column;
  }

  .settings-input-row .vibrant-nav-btn {
    width: 100%;
  }

  .settings-divider {
    margin: 0 1rem;
  }

  .settings-section-header {
    padding: 1.2rem;
  }
}