@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Syne:wght@500;700;800&display=swap");

:root {
  --bg: #0a0d14;
  --bg-soft: #101624;
  --panel: rgba(19, 27, 43, 0.72);
  --panel-strong: rgba(17, 24, 38, 0.9);
  --border: rgba(189, 233, 255, 0.12);
  --border-strong: rgba(189, 233, 255, 0.22);
  --text: #eff6ff;
  --muted: #90a4bc;
  --cyan: #9be7ff;
  --cyan-strong: #5fc8ff;
  --mint: #8df5c8;
  --violet: #ba7cff;
  --violet-strong: #8e52ff;
  --danger: #ff8d8d;
  --warning: #ffd683;
  --shadow: 0 28px 80px rgba(1, 6, 18, 0.45);
  --glass-blur: blur(18px);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --sidebar-width: 296px;
  --player-height: 108px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(90, 108, 255, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(186, 124, 255, 0.22), transparent 26%),
    radial-gradient(circle at bottom center, rgba(95, 200, 255, 0.12), transparent 34%),
    linear-gradient(135deg, #06080f 0%, #0d1320 48%, #0a0d14 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 48%, transparent 100%);
  opacity: 0.25;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.page-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  padding: 20px;
  gap: 20px;
  padding-bottom: calc(var(--player-height) + 28px);
}

.sidebar,
.glass-card,
.hero,
.player-bar,
.section-card,
.metric-card,
.auth-card,
.track-form,
.plan-card,
.table-card,
.notice-banner,
.admin-shell {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px - var(--player-height));
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(155, 231, 255, 0.18), rgba(186, 124, 255, 0.45)),
    #111827;
  display: grid;
  place-items: center;
  font-family: "Syne", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  box-shadow: inset 0 1px 18px rgba(255, 255, 255, 0.14), 0 16px 34px rgba(25, 34, 64, 0.45);
}

.brand-copy h1,
.brand-copy h2,
.section-heading h2,
.hero-copy h2,
.panel-heading h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-copy p,
.eyebrow,
.section-heading p,
.hero-copy p,
.panel-heading p,
.muted {
  margin: 0;
  color: var(--muted);
}

.sidebar-group {
  display: grid;
  gap: 10px;
}

.sidebar-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.52);
}

.nav-link,
.admin-link,
.chip,
.plan-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-link,
.admin-link {
  padding: 14px 16px;
  border-radius: 16px;
  color: #d8e3f3;
  border: 1px solid transparent;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.nav-link:hover,
.nav-link.active,
.admin-link:hover,
.admin-link.active {
  transform: translateX(4px);
  background: rgba(155, 231, 255, 0.08);
  border-color: rgba(155, 231, 255, 0.16);
}

.admin-link {
  justify-content: center;
  background: linear-gradient(135deg, rgba(95, 200, 255, 0.14), rgba(186, 124, 255, 0.16));
}

.sidebar-note {
  padding: 16px;
  border-radius: 18px;
  background: rgba(9, 14, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip,
.tag,
.plan-pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.chip.active,
.tag.premium {
  color: #071017;
  background: linear-gradient(135deg, var(--mint), var(--cyan));
  border-color: transparent;
}

.tag.admin {
  background: linear-gradient(135deg, rgba(186, 124, 255, 0.28), rgba(95, 200, 255, 0.18));
  border-color: rgba(186, 124, 255, 0.25);
}

.main-content {
  display: grid;
  gap: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 18px;
  background: rgba(8, 12, 20, 0.64);
  border: 1px solid var(--border);
  border-radius: 20px;
  flex: 1;
}

.search-bar input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.button,
.ghost-button,
.outline-button {
  border: 0;
  cursor: pointer;
  border-radius: 16px;
  padding: 14px 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.button {
  color: #041117;
  font-weight: 800;
  background: linear-gradient(135deg, var(--mint), var(--cyan));
  box-shadow: 0 16px 30px rgba(88, 212, 255, 0.24);
}

.button:hover,
.ghost-button:hover,
.outline-button:hover {
  transform: translateY(-2px);
}

.ghost-button {
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

.outline-button {
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
}

.button.full,
.ghost-button.full,
.outline-button.full {
  width: 100%;
}

.notice-banner {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.notice-banner.warning {
  border-color: rgba(255, 214, 131, 0.28);
}

.notice-banner.error {
  border-color: rgba(255, 141, 141, 0.28);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.85fr);
  gap: 24px;
  min-height: 440px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(186, 124, 255, 0.34), transparent 68%);
  filter: blur(10px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.eyebrow {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero-copy h2 {
  font-size: clamp(2.8rem, 5vw, 5.6rem);
  line-height: 0.94;
}

.hero-copy p {
  max-width: 62ch;
  font-size: 1.03rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-stats,
.metric-grid,
.plan-grid,
.two-column,
.cards-grid,
.playlist-grid,
.upload-grid,
.admin-grid,
.metrics-grid {
  display: grid;
  gap: 18px;
}

.hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.stat-card,
.metric-card,
.plan-card,
.feature-card,
.demo-card,
.playlist-card,
.auth-card,
.table-card,
.track-form {
  padding: 22px;
  background: rgba(8, 12, 20, 0.62);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card strong,
.metric-card strong,
.plan-price,
.feature-card strong {
  display: block;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-family: "Syne", sans-serif;
  letter-spacing: -0.05em;
}

.stat-card span,
.metric-card span,
.track-meta span,
.kpi-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
}

.showcase-stack {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 0.9;
}

.cover-frame {
  position: absolute;
  inset: auto;
  width: 72%;
  min-height: 250px;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.08), rgba(8, 11, 20, 0.55));
  box-shadow: 0 24px 50px rgba(4, 8, 18, 0.42);
}

.cover-frame::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  margin-bottom: 16px;
}

.cover-frame small {
  display: block;
  color: var(--muted);
}

.cover-frame strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.cover-frame.one {
  left: 0;
  top: 12%;
  transform: rotate(-12deg);
}

.cover-frame.one::before {
  background:
    linear-gradient(160deg, rgba(95, 200, 255, 0.84), rgba(17, 25, 37, 0.2)),
    radial-gradient(circle at top, rgba(155, 231, 255, 0.7), transparent 48%);
}

.cover-frame.two {
  right: 0;
  top: 0;
  transform: rotate(8deg);
}

.cover-frame.two::before {
  background:
    linear-gradient(150deg, rgba(186, 124, 255, 0.78), rgba(10, 15, 25, 0.3)),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.2), transparent 50%);
}

.cover-frame.three {
  left: 14%;
  bottom: 0;
  width: 76%;
  transform: rotate(-2deg);
}

.cover-frame.three::before {
  background:
    linear-gradient(170deg, rgba(141, 245, 200, 0.74), rgba(9, 13, 21, 0.28)),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.18), transparent 45%);
}

.section-card {
  padding: 28px;
}

.section-heading,
.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-heading h2,
.panel-heading h2 {
  font-size: clamp(1.8rem, 2.3vw, 2.6rem);
}

.cards-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.demo-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 0.28s ease, border-color 0.28s ease;
}

.demo-card:hover,
.playlist-card:hover,
.feature-card:hover,
.plan-card:hover {
  transform: translateY(-6px);
  border-color: rgba(155, 231, 255, 0.18);
}

.cover-art {
  position: relative;
  border-radius: 24px;
  aspect-ratio: 0.82;
  overflow: hidden;
  background: linear-gradient(145deg, #1b273d, #0b0f18);
}

.cover-art::before,
.cover-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(4px);
}

.cover-art::before {
  inset: 10% 12% auto auto;
  width: 110px;
  height: 110px;
  background: rgba(186, 124, 255, 0.5);
}

.cover-art::after {
  inset: auto auto 12% 10%;
  width: 130px;
  height: 130px;
  background: rgba(95, 200, 255, 0.45);
}

.cover-art .cover-lines {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 0 32%, rgba(255, 255, 255, 0.08) 32% 34%, transparent 34% 64%, rgba(255, 255, 255, 0.06) 64% 66%, transparent 66%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 55%);
}

.cover-art .cover-label {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(9, 13, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-card h3,
.feature-card h3,
.playlist-card h3,
.auth-card h3,
.plan-card h3,
.table-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.demo-card p,
.feature-card p,
.playlist-card p,
.auth-card p,
.plan-card p,
.table-card p,
.track-form p,
label span,
.list-clean li {
  color: var(--muted);
}

.meta-row,
.track-meta,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi {
  font-size: 0.84rem;
  color: var(--cyan);
}

.playlist-grid,
.plan-grid,
.two-column,
.metrics-grid,
.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card {
  display: grid;
  gap: 14px;
}

.feature-number {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(141, 245, 200, 0.18), rgba(95, 200, 255, 0.22));
  color: var(--mint);
  font-weight: 700;
}

.list-clean {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.auth-card form,
.track-form form {
  display: grid;
  gap: 14px;
}

.field-row,
.field-grid {
  display: grid;
  gap: 14px;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.94rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  color: var(--text);
  background: rgba(6, 10, 17, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(155, 231, 255, 0.36);
  box-shadow: 0 0 0 4px rgba(155, 231, 255, 0.08);
}

textarea {
  min-height: 130px;
  resize: vertical;
}

.status-box {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  min-height: 88px;
}

.plan-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
}

.plan-card.highlight {
  border-color: rgba(141, 245, 200, 0.28);
}

.plan-card.highlight::before {
  content: "";
  position: absolute;
  inset: -25% auto auto -20%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(141, 245, 200, 0.18), transparent 68%);
}

.plan-price {
  font-size: clamp(2rem, 3vw, 3rem);
}

.plan-price small {
  font-size: 0.95rem;
  color: var(--muted);
  font-family: "Manrope", sans-serif;
}

.plan-features {
  display: grid;
  gap: 10px;
}

.plan-features div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dce8f5;
}

.payment-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.payment-method {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.table-card {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.48);
  padding: 0 0 16px;
}

tbody td {
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.player-bar {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 20;
  min-height: var(--player-height);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(200px, 1fr) minmax(240px, 0.8fr);
  gap: 18px;
  align-items: center;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
}

.track-thumb {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(95, 200, 255, 0.3), rgba(186, 124, 255, 0.45));
}

.player-controls,
.player-extras {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
}

.player-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  appearance: none;
}

.player-icon.active {
  color: #041117;
  border-color: transparent;
  background: linear-gradient(135deg, var(--mint), var(--cyan));
}

.player-progress {
  display: grid;
  gap: 10px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  cursor: pointer;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--mint), var(--cyan), var(--violet));
}

.admin-page .page-shell {
  grid-template-columns: 1fr;
}

.admin-shell {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-locked {
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.admin-locked .glass-card {
  max-width: 620px;
  padding: 34px;
  text-align: center;
}

.admin-grid .track-form,
.admin-grid .table-card {
  height: 100%;
}

.hidden {
  display: none !important;
}

.soft-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  margin: 6px 0;
}

.accent {
  color: var(--cyan);
}

.accent-violet {
  color: var(--violet);
}

.danger {
  color: var(--danger);
}

.success {
  color: var(--mint);
}

@media (max-width: 1180px) {
  .page-shell,
  .admin-page .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .hero,
  .player-bar,
  .cards-grid,
  .two-column,
  .auth-grid,
  .playlist-grid,
  .plan-grid,
  .admin-grid,
  .metrics-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .player-bar {
    left: 16px;
    right: 16px;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 14px;
    gap: 14px;
    padding-bottom: calc(var(--player-height) + 26px);
  }

  .sidebar,
  .section-card,
  .hero,
  .player-bar,
  .admin-shell {
    padding: 20px;
  }

  .topbar,
  .section-heading,
  .panel-heading,
  .admin-topbar,
  .notice-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-copy h2 {
    font-size: 2.6rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .player-controls,
  .player-extras {
    justify-content: flex-start;
  }
}

/* ==========================================================================
   MODAL DO YOUTUBE (GLASSMORPHISM PREMIUM)
   ========================================================================== */

/* Fundo do Modal (Escurecido e com o desfoque padrão do teu tema) */
#youtube-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.52); /* Baseado no teu --bg com transparência */
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* Estado Ativo do Modal */
#youtube-modal.active {
  opacity: 1;
  pointer-events: auto;
}

/* Caixa do Player (Seguindo a estrutura dos teus .glass-card) */
.modal-glass-content {
  position: relative;
  background: var(--panel-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 840px;
  box-shadow: var(--shadow);
  transform: scale(0.92);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animação de entrada da caixa */
#youtube-modal.active .modal-glass-content {
  transform: scale(1);
}

/* Botão de Fechar Minimalista */
.modal-close-btn {
  position: absolute;
  top: -46px;
  right: 4px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 2.2rem;
  cursor: pointer;
  transition: color 0.25s ease, transform 0.25s ease;
  display: grid;
  place-items: center;
}

.modal-close-btn:hover {
  color: var(--text);
  transform: scale(1.1);
}

/* Wrapper para manter a proporção do vídeo em 16:9 (Responsivo) */
.iframe-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* Proporção 16:9 */
  height: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  background: #000;
}

.iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Ajuste para ecrãs pequenos (Mobile) */
@media (max-width: 760px) {
  .modal-glass-content {
    padding: 14px;
    border-radius: var(--radius-lg);
  }
  .modal-close-btn {
    top: -40px;
    font-size: 1.8rem;
  }
}