/* Settings Page Styles */

.settings-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  animation: settings-fade-in 0.5s ease-out;
}

@keyframes settings-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-section {
  background: var(--bg-panel);
  border-radius: 20px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  /* Removed fixed z-index to allow dynamic elevation */
}

/* Elevate the entire section when a dropdown is active within it */
.settings-section:focus-within,
.settings-section:hover {
  z-index: 100;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 205, 48, 0.1);
  border-radius: 8px;
  color: var(--accent);
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  text-transform: uppercase;
}

/* ─── Hotkeys Grid ─── */
.hotkeys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.hotkey-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.3s ease;
}

.hotkey-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 205, 48, 0.2);
}

.hotkey-label {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 400;
}

.hotkey-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--accent);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 11px;
  padding: 6px 12px;
  min-width: 80px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hotkey-btn:hover {
  border-color: var(--accent);
  background: rgba(255, 205, 48, 0.05);
}

.hotkey-btn.recording {
  background: var(--accent);
  color: #000;
  animation: pulse-border 1s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(255, 205, 48, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(255, 205, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 205, 48, 0); }
}

/* ─── Settings List (Toggles) ─── */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.setting-desc {
  font-size: 12px;
  color: var(--text-dim);
}

/* ─── Modern Switch ─── */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { 
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
  margin: 0;
}

.slider {
  position: absolute;
  pointer-events: none; /* Let clicks pass to the input */
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

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

/* ─── Controls (Selects - Custom Premium Dropdown) ─── */
.audio-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 20px;
  align-items: flex-end;
}

.select-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.select-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding-left: 4px;
}

.custom-select {
  position: relative;
  width: 100%;
  user-select: none;
}

.select-trigger {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 10;
}

.select-trigger:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 205, 48, 0.3);
}

.custom-select.active .select-trigger {
  border-color: var(--accent);
  background: rgba(255, 205, 48, 0.05);
  box-shadow: 0 0 20px rgba(255, 205, 48, 0.1);
}

.select-trigger .arrow {
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255, 255, 255, 0.3);
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  transform: rotate(45deg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: -4px;
  margin-right: 2px;
}

.custom-select.active .select-trigger .arrow {
  transform: rotate(-135deg);
  border-color: var(--accent);
  margin-top: 2px;
}

.select-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #1e1e35;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow-y: auto;
  max-height: 260px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Custom Scrollbar for Language List */
.select-options::-webkit-scrollbar {
  width: 4px;
}

.select-options::-webkit-scrollbar-track {
  background: transparent;
}

.select-options::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.select-options::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 205, 48, 0.3);
}

.custom-select.active .select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.option {
  padding: 12px 16px;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option:hover {
  background: rgba(255, 205, 48, 0.1);
  color: #fff;
}

.option.selected {
  background: rgba(255, 205, 48, 0.15);
  color: var(--accent);
  font-weight: 700;
}

.preview-btn {
  height: 44px;
  width: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--accent);
  border: none;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(255, 205, 48, 0.2);
}

.preview-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.preview-btn:hover svg {
  transform: scale(1.2);
}

.preview-btn:active {
  transform: scale(0.9);
}

/* ─── Premium Toast (Match Session Style) ─── */
.toast {
  position: fixed;
  bottom: 40px;
  right: 40px;
  transform: translateY(20px);
  background: #FFCD30;
  color: #000;
  padding: 16px 32px;
  border-radius: 16px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 1.5px;
  z-index: 10001;
  box-shadow: 0 20px 40px rgba(255,205,48,0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.settings-footer {
  margin-top: 20px;
  padding: 20px 0;
  display: flex;
  justify-content: center;
}

#apply-settings {
  max-width: 400px;
  background: var(--accent);
  color: #000;
  font-weight: 900;
  letter-spacing: 2px;
  height: 56px;
  box-shadow: 0 10px 40px rgba(255, 205, 48, 0.3);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#apply-settings:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 50px rgba(255, 205, 48, 0.4);
}

#apply-settings:active {
  transform: translateY(0) scale(0.98);
}

.toast-icon {
  width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.1);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ─── Responsive: 768px (Tablets & Mobile) ─── */
@media (max-width: 768px) {
    .settings-container {
        padding: 0 10px;
        gap: 16px;
    }

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

    .section-title {
        font-size: 16px;
    }

    .audio-controls {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .preview-btn {
        width: 100%;
        height: 48px;
        margin-top: 4px;
    }

    .hotkeys-grid {
        grid-template-columns: 1fr;
    }

    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 14px;
    }

    .setting-row .switch {
        align-self: flex-end;
    }

    .settings-footer {
        padding: 10px 0 30px;
    }

    #apply-settings {
        max-width: 100%;
        height: 52px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
  #settings-content-wrapper > div:nth-child(2) {
    display: none;
  }
}
