/* ═══════════════════════════════════════════════════════════════
   soliplayer.com — Dashboard Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ─── Dashboard Layout ───────────────────────────────────────────── */
.dash-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────── */
.dash-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--bg-border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform 0.3s var(--ease-snappy);
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--bg-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-mark {
  width: 32px; height: 32px;
  background: var(--grad-brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: white;
}

.sidebar-logo-text {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 8px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(123,92,246,0.15);
  color: var(--soli-violet-light);
  font-weight: 600;
}

.sidebar-link .icon {
  font-size: 16px;
  width: 20px;
  display: flex;
  justify-content: center;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--soli-violet);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--bg-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-user:hover { background: var(--bg-elevated); }

.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--grad-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-plan {
  font-size: 0.75rem;
  color: var(--soli-violet-light);
}

/* ─── Main Content ───────────────────────────────────────────────── */
.dash-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8,8,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bg-border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  transition: border-color 0.2s;
}
.topbar-search:focus-within { border-color: rgba(123,92,246,0.5); }
.topbar-search input {
  background: none;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text-primary);
  width: 200px;
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search-icon { color: var(--text-muted); font-size: 14px; }

/* ─── Dashboard Pages ────────────────────────────────────────────── */
.dash-page {
  padding: 32px;
  display: none;
  flex: 1;
}
.dash-page.active { display: block; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Stats Row ──────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 20px;
  background: var(--grad-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-value.violet { color: var(--soli-violet-light); }
.stat-value.cyan   { color: var(--soli-cyan); }
.stat-value.gold   { color: var(--soli-gold); }
.stat-value.green  { color: #4ADE80; }

.stat-change {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--grad-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--bg-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
}

.card-body { padding: 24px; }

/* ─── Playlist Table ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--bg-border);
}

tbody tr {
  border-bottom: 1px solid var(--bg-border);
  transition: background 0.15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.025); }

tbody td {
  padding: 14px 16px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

.td-name {
  font-weight: 600;
  color: var(--text-primary) !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

.provider-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.provider-icon.m3u    { background: rgba(34,211,238,0.15); }
.provider-icon.xtream { background: rgba(123,92,246,0.15); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge.active {
  background: rgba(74,222,128,0.12);
  color: #4ADE80;
}
.status-badge.syncing {
  background: rgba(251,191,36,0.12);
  color: #FBB424;
}
.status-badge.error {
  background: rgba(239,68,68,0.12);
  color: #EF4444;
}
.status-badge::before {
  content: '●';
  font-size: 8px;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-border);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
  font-size: 14px;
}
.icon-btn:hover { border-color: rgba(123,92,246,0.4); color: var(--text-primary); background: var(--bg-card); }
.icon-btn.danger:hover { border-color: rgba(239,68,68,0.4); color: #EF4444; }

/* ─── Modal ──────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  padding: 32px;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s var(--ease-snappy);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-surface); }

/* ─── Forms ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--soli-violet);
  box-shadow: 0 0 0 3px rgba(123,92,246,0.15);
}
.form-input::placeholder { color: var(--text-muted); }

.form-select { cursor: pointer; }
.form-select option { background: var(--bg-card); }

.form-textarea { resize: vertical; min-height: 100px; }

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--bg-border);
}

/* Provider type radio tabs */
.type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.type-tab {
  padding: 12px;
  background: var(--bg-elevated);
  border: 2px solid var(--bg-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.type-tab:hover { border-color: rgba(123,92,246,0.4); }
.type-tab.selected {
  border-color: var(--soli-violet);
  background: rgba(123,92,246,0.12);
}
.type-tab-icon { font-size: 20px; margin-bottom: 4px; }
.type-tab-label { font-size: 0.8125rem; font-weight: 600; }
.type-tab-desc  { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.toggle-info { display: flex; flex-direction: column; gap: 2px; }
.toggle-title { font-size: 0.9375rem; font-weight: 600; }
.toggle-desc  { font-size: 0.8125rem; color: var(--text-muted); }

.toggle {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  top: 2px; left: 2px;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--soli-violet); border-color: var(--soli-violet); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Sync code display */
.sync-code-box {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0;
}
.sync-code {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  font-family: monospace;
  color: var(--soli-violet-light);
}
.sync-code-copy {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
}
.sync-code-copy:hover { border-color: rgba(123,92,246,0.4); color: var(--text-primary); }

/* ─── Empty State ────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 32px;
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.empty-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ─── Toast ──────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  font-size: 0.9375rem;
  max-width: 320px;
  animation: toastIn 0.3s var(--ease-snappy);
}
.toast.success { border-left: 3px solid #4ADE80; }
.toast.error   { border-left: 3px solid #EF4444; }
.toast.info    { border-left: 3px solid var(--soli-violet); }

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

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dash-sidebar { transform: translateX(-100%); }
  .dash-sidebar.open { transform: translateX(0); }
  .dash-main { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .dash-page { padding: 20px; }
  .dash-topbar { padding: 0 20px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
