/* ==========================================================
   Music Player - Main Stylesheet
   Dark blue/purple glassmorphism theme
   ========================================================== */

:root {
  --bg-deep: #120b2e;
  --bg-mid: #1c1147;
  --bg-accent: #2a1a63;
  --purple: #7b5cf0;
  --purple-light: #a78bfa;
  --lime: #d4f96a;
  --text-main: #f4f2ff;
  --text-muted: #b9b3d8;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 20px 60px rgba(10, 5, 30, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at 15% 10%, #2b1a68 0%, transparent 45%),
              radial-gradient(circle at 85% 0%, #3a2179 0%, transparent 40%),
              linear-gradient(160deg, var(--bg-deep) 0%, var(--bg-mid) 55%, var(--bg-accent) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: 120px; /* room for sticky player */
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Glass card base ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

/* ---------- Navbar ---------- */
.navbar {
  margin: 24px auto 0;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar .logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.navbar .logo span { color: var(--lime); }

.navbar nav ul {
  display: flex;
  gap: 30px;
}

.navbar nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.navbar nav a:hover,
.navbar nav a.active {
  color: var(--text-main);
}

.btn-pill {
  background: var(--lime);
  color: #10142a;
  padding: 10px 22px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(212, 249, 106, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 9px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
}

.btn-outline:hover { border-color: var(--purple-light); }

/* ---------- Hero ---------- */
.hero {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 30px;
  align-items: center;
}

.hero-copy h1 {
  font-size: 46px;
  line-height: 1.15;
  margin: 0 0 18px;
  font-weight: 700;
}

.hero-copy p {
  color: var(--text-muted);
  max-width: 380px;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 30px;
}

.hero-stats {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
}

.hero-stats .stat-number {
  font-size: 26px;
  font-weight: 700;
  color: var(--lime);
}

.hero-stats .stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 340px;
}

.hero-visual .glow-circle {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e8ffb0, var(--lime) 60%, #a9d13a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 30px 80px rgba(212, 249, 106, 0.25);
}

.hero-visual .glow-circle i {
  font-size: 90px;
  color: rgba(16, 20, 42, 0.55);
}

.hero-visual .spark {
  position: absolute;
  top: 10px;
  right: 30px;
  font-size: 34px;
  color: var(--lime);
}

/* mini controls under hero copy */
.mini-controls {
  display: flex;
  gap: 14px;
}

.mini-controls button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-main);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.mini-controls button:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-2px);
}

/* ---------- Song list section ---------- */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 50px 0 18px;
}

.section-title h2 {
  font-size: 22px;
  margin: 0;
}

.section-title span {
  color: var(--text-muted);
  font-size: 13px;
}

.song-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.song-row {
  display: grid;
  grid-template-columns: 46px 1fr auto 40px;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
  cursor: pointer;
}

.song-row:hover,
.song-row.playing {
  background: rgba(255, 255, 255, 0.08);
}

.song-row.playing {
  border: 1px solid var(--purple-light);
}

.song-thumb {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), #ff7a59);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.song-info .song-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 2px;
}

.song-info .song-artist {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.song-duration {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.song-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--lime);
  color: #10142a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 40px;
  margin-bottom: 14px;
  color: var(--purple-light);
  display: block;
}

/* ---------- Sticky bottom player ---------- */
.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  margin: 0 auto;
  width: min(1200px, calc(100% - 32px));
  padding: 14px 22px;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  gap: 16px;
  z-index: 50;
}

.player-track-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-track-info .song-thumb { width: 42px; height: 42px; font-size: 14px; }

.player-track-info .info h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.player-track-info .info p {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

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

.player-controls button {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 16px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.player-controls button:hover { background: rgba(255,255,255,0.1); }

.player-controls .play-btn {
  width: 46px;
  height: 46px;
  background: var(--lime);
  color: #10142a;
  font-size: 18px;
}

.player-controls .play-btn:hover { background: #e3ff8c; }

.seek-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 11px;
  color: var(--text-muted);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,0.18);
  outline: none;
  flex: 1;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--lime);
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(212, 249, 106, 0.2);
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: var(--lime);
  cursor: pointer;
}

.player-volume {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.player-volume input[type="range"] { max-width: 100px; }
.player-volume i { color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 30px 0 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.site-footer a { color: var(--purple-light); }

/* ==========================================================
   Admin panel
   ========================================================== */
.admin-body {
  background: linear-gradient(160deg, var(--bg-deep) 0%, var(--bg-mid) 55%, var(--bg-accent) 100%);
  min-height: 100vh;
  padding-bottom: 60px;
}

.admin-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 24px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 26px;
  margin-bottom: 26px;
}

.admin-header .logo { font-size: 20px; font-weight: 700; }
.admin-header .logo span { color: var(--lime); }

.admin-card {
  padding: 28px;
  margin-bottom: 26px;
}

.admin-card h2 {
  margin-top: 0;
  font-size: 19px;
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text-main);
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: var(--purple-light);
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
}

.alert-success {
  background: rgba(120, 220, 130, 0.12);
  border: 1px solid rgba(120, 220, 130, 0.4);
  color: #b6f2bd;
}

.alert-error {
  background: rgba(255, 100, 100, 0.12);
  border: 1px solid rgba(255, 100, 100, 0.4);
  color: #ffb3b3;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--glass-border);
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.table-actions { display: flex; gap: 10px; }

.link-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
}

.link-btn.edit { color: var(--purple-light); border-color: rgba(167,139,250,0.4); }
.link-btn.delete { color: #ff9d9d; border-color: rgba(255,157,157,0.4); }
.link-btn:hover { background: rgba(255,255,255,0.08); }

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 40px 34px;
  text-align: center;
}

.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card p { color: var(--text-muted); font-size: 13px; margin-bottom: 26px; }
.login-card .btn-pill { width: 100%; padding: 13px; font-size: 15px; }

.back-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { order: -1; min-height: 240px; }
  .hero-visual .glow-circle { width: 220px; height: 220px; }
  .admin-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .player-bar {
    grid-template-columns: 1fr;
    bottom: 0;
    border-radius: 20px 20px 0 0;
    width: 100%;
  }
  .player-track-info { justify-content: center; }
  .player-volume { justify-content: center; }
  .navbar nav { display: none; }
  .hero-copy h1 { font-size: 34px; }
  .admin-header .logo { font-size: 18px; }
  .admin-table { display: block; overflow-x: auto; }
}

@media (max-width: 480px) {
  .navbar { padding: 12px 16px; }
  .container { padding: 0 14px; }
}
