@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  --bg-body: #090d16;
  --bg-sidebar: #0e1526;
  --bg-card: rgba(19, 28, 49, 0.7);
  --bg-card-hover: rgba(26, 38, 66, 0.85);
  --bg-input: rgba(11, 18, 33, 0.8);
  --border-color: rgba(255, 255, 255, 0.07);
  --border-focus: #6366f1;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
  
  --sidebar-w: 270px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 100;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 20px 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.brand-title {
  font-size: 16.5px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 2px;
  font-weight: 500;
}

.nav-section-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-sub);
  padding: 14px 10px 6px 10px;
  letter-spacing: 0.3px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  padding-left: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
  border: none !important;
  border-right: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: none !important;
  border-right: none !important;
  box-shadow: none !important;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font-weight: 600;
  border: none !important;
  border-right: none !important;
  box-shadow: none !important;
}

.nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  color: inherit;
}

/* Main Area */
.main-wrapper {
  margin-right: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.status-pill {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.user-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.user-badge:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-logout {
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.2);
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-logout:hover {
  background: var(--accent-rose);
  color: #fff;
  border-color: var(--accent-rose);
}

/* Content Area */
.content-area {
  padding: 32px 36px 60px 36px;
  flex: 1;
}

/* Professional Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
  transition: border-color 0.2s;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.11);
}

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

.card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Grid Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.icon-purple  { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.icon-pink    { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-cyan    { background: rgba(6, 182, 212, 0.15);  color: #22d3ee; }
.icon-amber   { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.icon-rose    { background: rgba(244, 63, 94, 0.15);  color: #fb7185; }

.stat-info h3 {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.stat-info p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* Forms & Inputs */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}

.form-input, .form-select, .form-textarea {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 11px 15px;
  color: var(--text-main);
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background-color: rgba(15, 23, 42, 0.95);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-sub);
}

/* Button Reset */
button {
  font-family: inherit;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

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

/* Special Button for Test Error Simulation */
.btn-test-error {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  font-weight: 600;
}

.btn-test-error:hover {
  background: rgba(245, 158, 11, 0.22) !important;
  color: #fde68a !important;
  border-color: rgba(245, 158, 11, 0.55) !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.25) !important;
  transform: translateY(-1px);
}

/* Visibility Toggle Button (Hide / Show) */
.btn-visibility {
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-sizing: border-box;
}

/* Active / Visible state: Sky Blue glow with dark translucent base */
.btn-visibility.is-visible {
  background: rgba(14, 165, 233, 0.12) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(14, 165, 233, 0.32) !important;
}

.btn-visibility.is-visible:hover {
  background: rgba(14, 165, 233, 0.25) !important;
  color: #bae6fd !important;
  border-color: rgba(14, 165, 233, 0.65) !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35) !important;
  transform: scale(1.08);
}

/* Inactive / Hidden state: Rose / Coral with dark translucent base */
.btn-visibility.is-hidden {
  background: rgba(244, 63, 94, 0.14) !important;
  color: #fb7185 !important;
  border: 1px solid rgba(244, 63, 94, 0.36) !important;
}

.btn-visibility.is-hidden:hover {
  background: rgba(244, 63, 94, 0.28) !important;
  color: #fecdd3 !important;
  border-color: rgba(244, 63, 94, 0.7) !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.35) !important;
  transform: scale(1.08);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: #fff;
}

.custom-table tbody tr {
  transition: opacity 0.25s ease, background-color 0.25s ease;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13.5px;
}

.custom-table th {
  background: rgba(11, 18, 33, 0.9);
  padding: 13px 18px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.cover-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-danger  { background: rgba(244, 63, 94, 0.15);  color: #fb7185; }
.badge-accent  { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.badge-amber   { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-cyan    { background: rgba(6, 182, 212, 0.15);  color: #22d3ee; }
.badge-purple  { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

/* Custom Audio Player */
audio {
  height: 34px;
  max-width: 210px;
  outline: none;
  filter: invert(0.9) hue-rotate(180deg);
  border-radius: 20px;
}

/* ================= GLOBAL STICKY PLAYER ================= */
.global-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: var(--sidebar-w);
  height: 82px;
  background: rgba(14, 21, 38, 0.95);
  backdrop-filter: blur(28px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 1000;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-left {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 260px;
  flex-shrink: 0;
}

.player-cover {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  background: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.player-meta {
  min-width: 0;
  flex: 1;
}

.player-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 580px;
  width: 100%;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.player-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, transform 0.1s;
  padding: 6px;
  border-radius: 50%;
}

.player-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

.player-btn.active {
  color: var(--primary);
}

.play-main-btn {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border-radius: 50%;
  font-size: 16px;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.play-main-btn:hover {
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.player-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.player-time {
  font-size: 11.5px;
  color: var(--text-sub);
  font-weight: 500;
  width: 36px;
  text-align: center;
}

.seek-bar {
  flex: 1;
  height: 5px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  transition: height 0.15s;
}

.seek-bar:hover {
  height: 7px;
}

.seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
  cursor: pointer;
}

.player-right {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 280px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.volume-bar {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.pill-chip {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

/* Lyrics Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.lyrics-box {
  background: rgba(14, 21, 38, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  padding: 28px;
}

.lyrics-content {
  overflow-y: auto;
  line-height: 2.2;
  font-size: 15px;
  color: #cbd5e1;
  text-align: center;
  padding: 16px 8px;
  white-space: pre-line;
}

/* Queue Drawer */
.queue-drawer {
  position: fixed;
  bottom: 82px;
  left: 36px;
  width: 340px;
  max-height: 480px;
  background: rgba(14, 21, 38, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  padding: 18px;
}

.queue-items {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.queue-item {
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.15s;
}

.queue-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.queue-item.active {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

