@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  --bg: #131313;
  --surface: #201f1f;
  --surface-high: #2a2a2a;
  --surface-highest: #353534;
  --primary: #1DB954;
  --primary-container: #1db954;
  --on-primary: #003914;
  --on-surface: #e5e2e1;
  --on-surface-variant: #bccbb9;
  --outline-variant: #3d4a3d;
  --sidebar-width: 240px;
  --player-height: 90px;
  --gutter: 1.5rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--on-surface);
  overflow: hidden;
  height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* ─── Icons ─── */
.icon {
  font-family: 'Material Symbols Outlined';
  font-weight: 400;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  vertical-align: middle;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}
.icon-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* ─── Typography ─── */
.display-lg { font-size: 48px; line-height: 56px; font-weight: 800; letter-spacing: -0.02em; }
.headline-lg { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.01em; }
.headline-md { font-size: 24px; line-height: 32px; font-weight: 700; }
.body-lg { font-size: 16px; line-height: 24px; font-weight: 500; }
.body-md { font-size: 14px; line-height: 20px; font-weight: 400; }
.label-md { font-size: 12px; line-height: 16px; font-weight: 600; }

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

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: var(--gutter);
  gap: 1rem;
  z-index: 50;
}
.sidebar .logo { font-size: 24px; font-weight: 700; color: var(--primary); }
.sidebar .tagline { font-size: 14px; color: var(--on-surface-variant); margin-bottom: 0.5rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--on-surface-variant);
  font-weight: 500;
  transition: color 0.2s;
}
.sidebar nav a:hover, .sidebar nav a.active { color: var(--on-surface); }
.sidebar nav a.active .icon { font-variation-settings: 'FILL' 1; }
.sidebar .btn-sidebar {
  width: 100%;
  padding: 12px;
  background: var(--surface-highest);
  border: none;
  border-radius: 9999px;
  color: var(--on-surface);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
  margin-top: 1rem;
}
.sidebar .btn-sidebar:hover { background: #454545; }
.sidebar .sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-top: 1px solid var(--outline-variant);
  padding-top: 1.5rem;
}
.sidebar .sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--on-surface-variant);
  font-weight: 500;
  transition: color 0.2s;
}
.sidebar .sidebar-footer a:hover { color: var(--on-surface); }

/* Top bar */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  width: calc(100% - var(--sidebar-width));
  height: 64px;
  background: rgba(19,19,19,0.8);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--gutter);
  z-index: 40;
}
.topbar .search-wrap {
  display: flex;
  align-items: center;
  background: var(--surface-highest);
  border-radius: 9999px;
  padding: 8px 16px;
  gap: 8px;
  width: 100%;
  max-width: 400px;
}
.topbar .search-wrap input {
  background: transparent;
  border: none;
  color: var(--on-surface);
  font-size: 14px;
  width: 100%;
  outline: none;
}
.topbar .search-wrap input::placeholder { color: var(--on-surface-variant); }
.topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.topbar .topbar-actions .icon {
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: color 0.2s;
}
.topbar .topbar-actions .icon:hover { color: var(--on-surface); }

/* Main content */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: 64px;
  margin-bottom: var(--player-height);
  height: calc(100vh - 64px - var(--player-height));
  overflow-y: auto;
  background: var(--bg);
  width: calc(100% - var(--sidebar-width));
}
.main-content::-webkit-scrollbar { width: 8px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: #353534; border-radius: 4px; }
.main-content::-webkit-scrollbar-thumb:hover { background: #474746; }

.content { padding: var(--gutter); }

/* ─── Player Bar ─── */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--player-height);
  background: var(--surface-high);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  z-index: 50;
  border-top: 1px solid rgba(61,74,61,0.1);
}
.player-bar .track-info { display: flex; align-items: center; gap: 1rem; width: 30%; }
.player-bar .track-info .cover {
  width: 56px; height: 56px;
  background: var(--surface) url('../images/fatecfy.png') center/cover no-repeat;
  border-radius: 4px;
  display: flex;
  align-items: center; justify-content: center;
}
.player-bar .track-info .cover .icon { font-size: 28px; color: var(--on-surface-variant); }
.player-bar .track-info .meta h4 { font-size: 14px; font-weight: 700; }
.player-bar .track-info .meta p { font-size: 11px; color: var(--on-surface-variant); }
.player-bar .playback { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 40%; }
.player-bar .playback .controls { display: flex; align-items: center; gap: 1.5rem; }
.player-bar .playback .controls .icon { color: var(--on-surface); cursor: pointer; transition: color 0.2s; }
.player-bar .playback .controls .icon:hover { color: var(--primary); }
.player-bar .playback .progress {
  display: flex; align-items: center; gap: 8px; width: 100%; max-width: 500px;
}
.player-bar .playback .progress time { font-size: 10px; color: var(--on-surface-variant); }
.player-bar .playback .progress .bar {
  flex: 1; height: 4px; background: var(--surface-variant); border-radius: 9999px; overflow: hidden; cursor: pointer;
}
.player-bar .playback .progress .bar .fill {
  height: 100%; width: 0%; background: var(--on-surface); border-radius: 9999px; transition: background 0.2s;
}
.player-bar .playback .progress .bar:hover .fill { background: var(--primary); }
.player-bar .utility { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; width: 30%; }
.player-bar .utility .icon { color: var(--on-surface-variant); cursor: pointer; transition: color 0.2s; font-size: 20px; }
.player-bar .utility .icon:hover { color: var(--on-surface); }

/* ─── Cards ─── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
  transition: background 0.2s;
  cursor: pointer;
}
.card:hover { background: var(--surface-high); }
.card .thumb {
  width: 100%;
  aspect-ratio: 1;
  background: #333 url('../images/fatecfy.png') center/cover no-repeat;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
}
.card .thumb .icon { font-size: 2.5rem; color: var(--on-surface-variant); }
.card .thumb.round { border-radius: 50%; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card p { font-size: 14px; color: var(--on-surface-variant); }

/* Floating play button on card hover */
.card-wrap { position: relative; }
.play-btn-float {
  position: absolute;
  bottom: 0.75rem; right: 0.75rem;
  width: 48px; height: 48px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.card-wrap:hover .play-btn-float { opacity: 1; transform: translateY(0); }
.play-btn-float .icon { font-size: 28px; color: var(--on-primary); font-variation-settings: 'FILL' 1; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 24px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
  font-family: inherit;
}
.btn:hover { transform: scale(1.04); }
.btn-green { background: var(--primary); color: var(--on-primary); }
.btn-green:hover { background: #1ed760; }
.btn-outline { background: transparent; color: var(--on-surface); border: 1px solid var(--outline-variant); }
.btn-outline:hover { border-color: var(--on-surface); }
.btn-sm { padding: 4px 14px; font-size: 11px; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-icon {
  width: 56px; height: 56px;
  background: var(--primary); color: var(--on-primary);
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.btn-icon:hover { transform: scale(1.06); }
.btn-icon .icon { font-size: 32px; font-variation-settings: 'FILL' 1; }

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--on-surface-variant); margin-bottom: 4px; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: var(--surface-high);
  color: var(--on-surface);
  font-size: 14px;
}
.form-group input:focus { outline: 2px solid var(--primary); }

/* ─── Tables ─── */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
table th {
  text-align: left;
  padding: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-variant);
  border-bottom: 1px solid var(--outline-variant);
}
table td { padding: 12px; border-bottom: 1px solid transparent; font-size: 14px; }
table tbody tr { transition: background 0.15s; cursor: pointer; border-radius: 8px; }
table tbody tr:hover td { background: var(--surface-high); }
table tbody tr td:first-child { border-radius: 8px 0 0 8px; }
table tbody tr td:last-child { border-radius: 0 8px 8px 0; }

/* ─── Messages ─── */
.msg { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.msg-erro { background: #3e1a1a; color: #ffb4ab; border: 1px solid #5c2a2a; }
.msg-sucesso { background: #1a3e1a; color: #53e076; border: 1px solid #2a5c2a; }

/* ─── Empty state ─── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--on-surface-variant); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; color: #535353; }
.empty-state h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { margin-bottom: 16px; }

/* ─── Like button ─── */
.btn-like {
  background: none; border: none;
  cursor: pointer; padding: 4px;
  display: inline-flex; align-items: center;
  color: var(--on-surface-variant);
  transition: color 0.2s;
}
.btn-like:hover, .btn-like.liked { color: var(--primary); }
.btn-like .icon { font-size: 22px; transition: font-variation-settings 0.2s; }

/* ─── Filter chips ─── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chip {
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 12px; font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.chip-active { background: var(--primary); color: var(--on-primary); }
.chip-inactive { background: var(--surface-highest); color: var(--on-surface); }
.chip-inactive:hover { background: #454545; }

/* ─── Section header ─── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}
.section-header a {
  font-size: 12px; font-weight: 600;
  color: var(--on-surface-variant);
}
.section-header a:hover { color: var(--on-surface); text-decoration: underline; }

/* ─── Album/Artist Header ─── */
.gradient-header {
  background: linear-gradient(to bottom, rgba(29,185,84,0.25) 0%, var(--bg) 100%);
  padding: var(--gutter);
  padding-top: 2rem;
  display: flex;
  align-items: flex-end;
  gap: 2rem;
}
.gradient-header .cover-art {
  width: 232px; height: 232px;
  background: #333 url('../images/fatecfy.png') center/cover no-repeat;
  border-radius: 8px;
  display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.gradient-header .cover-art .icon { font-size: 3rem; color: var(--on-surface-variant); }
.gradient-header .cover-art img { width: 100%; height: 100%; object-fit: cover; }
.gradient-header .meta { display: flex; flex-direction: column; gap: 8px; }
.gradient-header .meta .label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.gradient-header .meta h1 { font-size: 48px; line-height: 56px; font-weight: 800; letter-spacing: -0.02em; }
.gradient-header .meta .details { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.gradient-header .meta .details .primary { color: var(--primary); font-weight: 700; }

.action-bar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem var(--gutter);
}

/* ─── Track rows ─── */
.track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}
.track-row:hover { background: var(--surface-high); }
.track-row .num { width: 24px; text-align: right; color: var(--on-surface-variant); font-size: 14px; }
.track-row .info { flex: 1; }
.track-row .info .name { font-size: 16px; font-weight: 500; }
.track-row .info .artists { font-size: 14px; color: var(--on-surface-variant); }
.track-row .actions { display: flex; gap: 8px; align-items: center; }

/* ─── Artist banner (artista.php) ─── */
.artist-banner {
  height: 350px;
  display: flex;
  align-items: flex-end;
  padding: var(--gutter);
  background: linear-gradient(transparent, rgba(19,19,19,1));
  position: relative;
}
.artist-banner .avatar {
  width: 180px; height: 180px;
  background: #333 url('../images/fatecfy.png') center/cover no-repeat;
  border-radius: 50%;
  display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.artist-banner .avatar .icon { font-size: 4rem; color: var(--on-surface-variant); }
.artist-banner .info { margin-left: 1.5rem; }
.artist-banner .info .label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
}
.artist-banner .info .label .icon { font-size: 18px; color: var(--primary); font-variation-settings: 'FILL' 1; }
.artist-banner .info h1 { font-size: 56px; line-height: 64px; font-weight: 800; letter-spacing: -0.02em; }
.artist-banner .info .listeners { font-size: 16px; color: var(--on-surface-variant); margin-top: 8px; }

/* ─── Bento grid item ─── */
.bento-item {
  display: flex;
  align-items: center;
  background: var(--surface-high);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}
.bento-item:hover { background: var(--surface-highest); }
.bento-item img { width: 80px; height: 80px; object-fit: cover; flex-shrink: 0; }
.bento-item .bento-thumb {
  width: 80px; height: 80px;
  background: #333 url('../images/fatecfy.png') center/cover no-repeat;
  display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bento-item span { padding: 0 16px; font-size: 16px; font-weight: 700; flex: 1; }
.bento-item .play-btn-float { position: absolute; right: 16px; opacity: 0; transition: opacity 0.2s; }
.bento-item:hover .play-btn-float { opacity: 1; }

/* ─── Misc utilities ─── */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mb-16 { margin-bottom: 16px; }
.mt-16 { margin-top: 16px; }
.mr-8 { margin-right: 8px; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.gap-8 { gap: 8px; }
.hidden { display: none; }
