/* ====== RESET BÁSICO ====== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  background: #020617;
  color: #e5e7eb;
  overflow-x: hidden;
}

/* ====== FONDO CON VIDEO + OVERLAY ====== */

.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: none;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 0%, rgba(236, 72, 153, 0.15), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(56, 189, 248, 0.15), transparent 55%),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.35));
}

/* ====== LAYOUT GENERAL ====== */

.app {
  min-height: 100vh;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #f97316, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #020617;
  box-shadow:
    0 0 25px rgba(236, 72, 153, 0.7),
    0 0 40px rgba(249, 115, 22, 0.6);
}

.logo-text {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 18px;
  color: #e5e7eb;
  text-shadow: 0 0 18px rgba(15, 23, 42, 0.8);
}

.subtitle {
  font-size: 14px;
  color: #9ca3af;
  max-width: 420px;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.6);
  color: #e5e7eb;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease-out;
  backdrop-filter: blur(12px);
}

.header-btn:hover {
  border-color: rgba(236, 72, 153, 0.9);
  color: #f9fafb;
  box-shadow:
    0 0 22px rgba(236, 72, 153, 0.6),
    0 0 40px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.header-btn-secondary {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.8);
}

/* ====== MAIN LAYOUT ====== */

.main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: flex-start;
}

/* Cuando solo queremos lista full width, el JS añade esta clase */
.main.fullwidth-list {
  grid-template-columns: minmax(0, 1fr);
}

/* ====== CARD / CONTENEDORES ====== */

.card {
  position: relative;
  padding: 16px 16px 18px;
  border-radius: 16px;
  background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.95),
      rgba(15, 23, 42, 0.92)
    );
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.9),
    0 0 32px rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(18px);
}

.upload-card::before,
.list-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  padding: 1px;
  background: conic-gradient(
    from 140deg,
    rgba(236, 72, 153, 0.3),
    rgba(56, 189, 248, 0.3),
    rgba(94, 234, 212, 0.25),
    transparent,
    rgba(236, 72, 153, 0.32)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.7;
  pointer-events: none;
}

.upload-card,
.list-card {
  overflow: hidden;
}

.upload-card h2,
.list-card h2 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #f9fafb;
}

/* ====== FORMULARIO SUBIDA ====== */

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.field label {
  font-size: 12px;
  color: #9ca3af;
}

.field input[type="text"],
.field input[type="file"] {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  color: #e5e7eb;
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  transition: all 0.18s ease-out;
}

.field input[type="text"]:focus,
.field input[type="file"]:focus {
  border-color: rgba(236, 72, 153, 0.9);
  box-shadow:
    0 0 16px rgba(236, 72, 153, 0.5),
    0 0 25px rgba(56, 189, 248, 0.6);
}

.hint {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 10px;
}

#uploadButton {
  margin-top: 4px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, #ec4899, #f97316);
  color: #020617;
  box-shadow:
    0 10px 26px rgba(236, 72, 153, 0.75),
    0 0 36px rgba(249, 115, 22, 0.7);
  transition: all 0.15s ease-out;
}

#uploadButton:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.01);
}

#uploadButton:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Mensajes estado */

.status {
  margin-top: 8px;
  font-size: 12px;
  color: #9ca3af;
}

.status.success {
  color: #4ade80;
}

.status.error {
  color: #fb7185;
}

/* ====== LISTA / SEARCH ====== */

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.badge {
  padding: 2px 10px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.8);
}

.search-bar {
  margin-bottom: 10px;
}

#searchInput {
  width: 100%;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.95);
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.16), transparent 55%),
              rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-size: 13px;
  outline: none;
  transition: all 0.18s ease-out;
}

#searchInput::placeholder {
  color: #6b7280;
}

#searchInput:focus {
  border-color: rgba(236, 72, 153, 0.9);
  box-shadow:
    0 0 20px rgba(236, 72, 153, 0.6),
    0 0 35px rgba(56, 189, 248, 0.5);
}

/* ====== TRACK LIST ====== */

.track-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Scroll estilo fino */
.track-list::-webkit-scrollbar {
  width: 6px;
}
.track-list::-webkit-scrollbar-track {
  background: transparent;
}
.track-list::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.8);
  border-radius: 999px;
}

/* Tarjeta de track */

.track-card {
  border-radius: 14px;
  padding: 9px 11px 8px;
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.18), transparent 60%),
              radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.22), transparent 60%),
              rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(30, 64, 175, 0.8);
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.9),
    0 0 24px rgba(30, 64, 175, 0.7);
}

.track-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.track-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.track-title {
  font-size: 14px;
  font-weight: 600;
  color: #f9fafb;
}

.track-artist {
  font-size: 12px;
  color: #c4b5fd;
}

.track-meta {
  font-size: 11px;
  color: #9ca3af;
}

.track-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.track-actions a {
  font-size: 11px;
  color: #7dd3fc;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.9);
  padding: 2px 10px;
  background: rgba(15, 23, 42, 0.92);
  cursor: pointer;
  transition: all 0.16s ease-out;
}

.track-actions a:hover {
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.7);
}

.track-delete {
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.9);
  padding: 2px 10px;
  background: rgba(127, 29, 29, 0.85);
  color: #fee2e2;
  cursor: pointer;
  transition: all 0.16s ease-out;
}

.track-delete:hover {
  background: #b91c1c;
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.8);
}

/* Audio player */

.track-card audio {
  width: 100%;
  margin-top: 6px;
  filter: drop-shadow(0 0 12px rgba(15, 23, 42, 0.9));
}

/* ====== FOOTER ====== */

.footer {
  margin-top: auto;
  font-size: 11px;
  color: #6b7280;
  text-align: center;
}

/* ====== RESPONSIVE ====== */

@media (max-width: 768px) {
  .app {
    padding: 16px 10px 26px;
  }

  .header {
    gap: 8px;
  }

  .header-actions {
    margin-left: 0;
    align-self: stretch;
    justify-content: flex-end;
  }

  .main,
  .main.fullwidth-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .track-list {
    max-height: none;
  }
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.03) 0px,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 2px,
      transparent 3px
    );
  z-index: 3;
  opacity: 0.08;
}
.app {
  filter: drop-shadow(0 0 25px rgba(236,72,153,0.4));
}
