/* ------------------------------
   SETTINGS PAGE LAYOUT
------------------------------ */
.settings-main {
  width: 100%;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-header h2 {
  color: var(--text);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--text-dim);
  font-size: 16px;
  margin: 0;
}

.save-settings-btn {
  align-self: flex-start;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(12, 17, 32, 0.88));
  border: 1px solid rgba(34, 197, 94, 0.48);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.save-settings-btn:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 1), rgba(12, 17, 32, 1));
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
  transform: translateY(-1px);
}

.save-settings-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.save-settings-btn .btn-icon {
  font-size: 16px;
}

/* ------------------------------
   SETTINGS GRID
------------------------------ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 800px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------
   SETTINGS SECTION (GLASS PANEL)
------------------------------ */
.settings-section {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.settings-section:hover {
  border-color: rgba(34, 197, 94, 0.36);
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(34, 197, 94, 0.08);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(34, 197, 94, 0.18);
}

.section-icon {
  font-size: 20px;
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.4));
}

/* ------------------------------
   SETTING ITEM
------------------------------ */
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 12px;
}

.setting-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.setting-item:first-of-type {
  padding-top: 0;
}

.setting-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.setting-description {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ------------------------------
   TOGGLE SWITCH
------------------------------ */
.toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  transition: transform 0.25s ease, background 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.85), rgba(12, 17, 32, 0.75));
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

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

.toggle:hover .toggle-slider {
  border-color: rgba(34, 197, 94, 0.4);
}

/* ------------------------------
   SELECT & INPUT
------------------------------ */
.setting-select,
.setting-input {
  min-width: 120px;
  max-width: 220px;
  height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
  flex-shrink: 1;
  backdrop-filter: blur(14px) saturate(140%);
}

.setting-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2322C55E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 34px;
}

.setting-input {
  cursor: text;
}

.setting-select:hover,
.setting-input:hover {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(255, 255, 255, 0.07);
}

.setting-select:active {
  transform: translateY(0);
}

.setting-select:focus,
.setting-input:focus {
  outline: none;
  border-color: rgba(34, 197, 94, 0.72);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18), 0 0 12px rgba(34, 197, 94, 0.2);
}

.setting-select option,
.setting-select optgroup {
  background: rgba(14, 14, 14, 0.98);
  color: var(--text);
}

/* ------------------------------
   BUTTONS
------------------------------ */
.btn-primary,
.btn-secondary,
.btn-danger {
  height: 38px;
  padding: 0 16px;
  min-width: 80px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.2s ease;
  border: none;
  outline: none;
  flex-shrink: 1;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.44) 0%, rgba(22, 132, 70, 0.38) 52%, rgba(12, 17, 32, 0.34) 100%);
  color: #fff;
  border: 1px solid rgba(34, 197, 94, 0.48);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.26);
  animation: rainbow-shift 50s linear infinite;
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(170, 179, 196, 0.2) 52%, rgba(0, 0, 0, 0.3) 100%);
  color: var(--text);
  border: 1px solid rgba(34, 197, 94, 0.32);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-danger {
  background: linear-gradient(135deg, rgba(131, 25, 20, 0.44) 0%, rgba(181, 34, 34, 0.38) 52%, rgba(12, 17, 32, 0.34) 100%);
  color: #fff;
  border: 1px solid rgba(131, 25, 20, 0.48);
  box-shadow: 0 0 14px rgba(131, 25, 20, 0.26);
  animation: rainbow-shift 50s linear infinite;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-primary:active,
.btn-secondary:active,
.btn-danger:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* ------------------------------
   STORAGE BADGE
------------------------------ */
.storage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-width: 60px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(255, 115, 115, 0.12);
  border: 1px solid rgba(255, 115, 115, 0.32);
  color: #ff7373;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 1;
  white-space: nowrap;
}

/* ------------------------------
   SETTINGS FOOTER
------------------------------ */
.settings-footer {
  text-align: center;
  padding: 24px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 115, 115, 0.18);
}

.settings-footer p {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0;
  font-style: italic;
}

/* Custom Dropdown Controls */
.settings-dropdown-control {
  position: relative;
  min-width: 120px;
  max-width: 220px;
  flex-shrink: 1;
}

.settings-dropdown-btn {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  padding-right: 38px;
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.32);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(14px) saturate(140%);
  text-align: left;
  position: relative;
}

.settings-dropdown-btn::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(34, 197, 94, 0.86);
  border-bottom: 2px solid rgba(34, 197, 94, 0.86);
  transform: translateY(-60%) rotate(45deg);
  transition: transform 0.16s ease;
}

.settings-dropdown-control.open .settings-dropdown-btn::after {
  transform: translateY(-30%) rotate(225deg);
}

.settings-dropdown-btn:hover {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(255, 255, 255, 0.07);
}

.settings-dropdown-btn:focus {
  outline: none;
  border-color: rgba(34, 197, 94, 0.72);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18), 0 0 12px rgba(34, 197, 94, 0.2);
}

.settings-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.32);
  background: rgba(14, 14, 14, 0.96);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.42), 0 0 12px rgba(34, 197, 94, 0.12);
  backdrop-filter: blur(14px) saturate(140%);
  z-index: 20;
  display: none;
}

.settings-dropdown-control.open .settings-dropdown-menu {
  display: grid;
  gap: 4px;
}

.settings-dropdown-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.settings-dropdown-item:hover,
.settings-dropdown-item:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(34, 197, 94, 0.4);
}

.settings-dropdown-item.is-active {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.48);
  color: #fff;
}

/* ------------------------------
   TOAST NOTIFICATIONS
------------------------------ */
.settings-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  backdrop-filter: blur(12px);
  max-width: 400px;
}

.settings-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.settings-toast-success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(74, 222, 128, 0.9));
  border: 1px solid rgba(34, 197, 94, 0.6);
}

.settings-toast-error {
  background: linear-gradient(135deg, rgba(131, 25, 20, 0.95), rgba(220, 38, 38, 0.9));
  border: 1px solid rgba(131, 25, 20, 0.6);
}

.settings-toast-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(96, 165, 250, 0.9));
  border: 1px solid rgba(59, 130, 246, 0.6);
}

/*  ------------------------------
   RESPONSIVE ADJUSTMENTS
------------------------------ */
@media (max-width: 600px) {
  .settings-section {
    padding: 18px;
  }
  
  .setting-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .setting-select,
  .setting-input,
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .storage-badge {
    width: 100%;
    max-width: 100%;
  }
  
  .toggle {
    align-self: flex-start;
  }
  
  .settings-grid {
    gap: 16px;
  }
  
  .page-header h2 {
    font-size: 26px;
  }
}
