/* ═══════════════════════════════════════════
   Auth Modal
   ═══════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
  display: none !important;
}

.auth-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.input-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.auth-submit-btn {
  width: 100%;
  padding: 0.8rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-top: 0.3rem;
}

.auth-submit-btn:hover {
  background: #e11d48;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.3);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.2rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-google-btn,
.auth-spotify-btn {
  width: 100%;
  padding: 0.7rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: var(--transition-fast);
  margin-bottom: 0.5rem;
}

.auth-google-btn:hover,
.auth-spotify-btn:hover {
  background: var(--bg-secondary);
  border-color: rgba(255, 255, 255, 0.12);
}

.auth-switch {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

.auth-switch button {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-switch button:hover {
  text-decoration: underline;
}

.auth-view.hidden {
  display: none;
}

.auth-error {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.85rem;
  text-align: center;
}

.auth-error.hidden { display: none; }

.auth-legal {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.8rem;
  line-height: 1.5;
  opacity: 0.7;
}

.auth-legal a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-legal a:hover {
  color: var(--text);
}

/* ═══════════════════════════════════════════
   Panel Modals (Preferences, Mixes, Upgrade)
   ═══════════════════════════════════════════ */

.panel-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease;
}

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

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-body { padding: 1.5rem; }

/* Preferences */
.pref-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.pref-group:last-of-type { border-bottom: none; }
.pref-label { font-size: 0.9rem; color: var(--text-secondary); }
.pref-select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
}
.pref-select:focus { border-color: var(--accent); }

.pref-toggle { position: relative; width: 44px; height: 24px; cursor: pointer; }
.pref-toggle input { display: none; }
.pref-toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: var(--transition-fast);
}
.pref-toggle-slider::after {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-secondary);
  top: 2px; left: 2px;
  transition: var(--transition-fast);
}
.pref-toggle input:checked + .pref-toggle-slider { background: var(--accent); border-color: var(--accent); }
.pref-toggle input:checked + .pref-toggle-slider::after { transform: translateX(20px); background: #fff; }

.pref-range-wrap { display: flex; align-items: center; gap: 0.6rem; }
.pref-range { width: 120px; accent-color: var(--accent); cursor: pointer; }
.pref-range-val { font-size: 0.8rem; color: var(--accent); min-width: 28px; text-align: right; }

.panel-action-btn {
  display: block; width: 100%; margin-top: 1.2rem; padding: 0.7rem;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); font-family: var(--font);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: var(--transition-fast);
}
.panel-action-btn:hover { filter: brightness(1.1); }

/* Saved Mixes */
.mixes-list { display: flex; flex-direction: column; gap: 0.6rem; }
.mixes-empty { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 2rem 0; }
.mix-card {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition-fast);
}
.mix-card:hover { border-color: rgba(255,255,255,0.12); }
.mix-cover { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--bg-primary); }
.mix-info { flex: 1; min-width: 0; }
.mix-name { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Upgrade */
.upgrade-modal { text-align: center; }
.upgrade-subtitle { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.5rem; }
.upgrade-features { list-style: none; padding: 0; text-align: left; margin-bottom: 1.5rem; }
.upgrade-features li {
  padding: 0.5rem 0 0.5rem 1.5rem; position: relative;
  color: var(--text-secondary); font-size: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}
.upgrade-features li:last-child { border-bottom: none; }
.upgrade-features li::before { content: '\2726'; position: absolute; left: 0; color: var(--accent); }
.upgrade-pricing { margin-bottom: 1.2rem; }
.upgrade-price { font-size: 2rem; font-weight: 700; color: var(--text-primary); }
.upgrade-price span { font-size: 0.9rem; font-weight: 400; color: var(--text-muted); }
.upgrade-annual { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }
.upgrade-buy-btn {
  display: block; width: 100%; padding: 0.8rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: var(--transition-fast); margin-bottom: 0.8rem;
}
.upgrade-buy-btn:hover { filter: brightness(1.1); }
.upgrade-note { font-size: 0.75rem; color: var(--text-muted); }

/* Dropdown extras */
.dropdown-item.accent { color: var(--accent); font-weight: 500; }
.dropdown-item.connected { color: var(--text-muted); opacity: 0.6; }
