/* =========================================
   TANGOFESTIVAL — CATALOGO CSS
   Mobile-first
   ========================================= */

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

:root {
  --green: #7fcc00;
  --green-dark: #6ab300;
  --green-text: #2a4500;
  --black: #0a0a0a;
  --s1: #141414;
  --s2: #1c1c1c;
  --s3: #252525;
  --s4: #2e2e2e;
  --border: rgba(255, 255, 255, 0.08);
  --border-h: rgba(255, 255, 255, 0.15);
  --t1: #ffffff;
  --t2: rgba(255, 255, 255, 0.55);
  --t3: rgba(255, 255, 255, 0.28);
  --danger: #ff5c5c;
  --nav-h: 52px;
  --bottom-h: 60px;
  --font: 'DM Sans', sans-serif;
  --font-brand: 'Bebas Neue', sans-serif;
  --r: 10px;
  --r-lg: 14px;
  --t: 0.18s ease;
}

html {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--t1);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}
button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--s1);
  border-bottom: 0.5px solid var(--border);
  transition: border-color var(--t);
}
.navbar.scrolled {
  border-bottom-color: rgba(255, 255, 255, 0.13);
}

.navbar-inner {
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}
.brand-logo {
  width: 28px;
  height: 28px;
  background: var(--green);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t);
}
.brand:hover .brand-logo {
  background: var(--green-dark);
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}
.brand-name {
  font-family: var(--font-brand);
  font-size: 15px;
  letter-spacing: 0.8px;
  color: var(--t1);
}
.brand-sub {
  font-size: 9px;
  color: var(--t3);
  font-weight: 400;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.nav-sep {
  width: 0.5px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

/* Language select */
.lang-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  height: 28px;
  background: var(--s2);
  border: 0.5px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.lang-wrap:hover {
  background: var(--s3);
  border-color: var(--border-h);
}
.lang-wrap svg:first-child {
  color: var(--t3);
  flex-shrink: 0;
}
.lang-select {
  appearance: none;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--t2);
  cursor: pointer;
  padding-right: 12px;
}
.lang-select option {
  background: var(--s2);
}
.lang-chevron {
  position: absolute;
  right: 6px;
  pointer-events: none;
  color: var(--t3);
}

/* User pill */
.user-wrap {
  position: relative;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px 3px 4px;
  background: var(--s2);
  border: 0.5px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
  outline: none;
}
.user-pill:hover,
.user-pill[aria-expanded='true'] {
  background: var(--s3);
  border-color: var(--border-h);
}
.user-pill:focus-visible {
  box-shadow: 0 0 0 2px rgba(127, 204, 0, 0.45);
}
.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 500;
  color: var(--green-text);
  flex-shrink: 0;
}
.user-email {
  font-size: 11px;
  color: var(--t2);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill-chevron {
  color: var(--t3);
  flex-shrink: 0;
  transition: transform var(--t);
}
.user-pill[aria-expanded='true'] .pill-chevron {
  transform: rotate(180deg);
}

/* Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--s1);
  border: 0.5px solid var(--border-h);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.2s ease, visibility 0.2s ease,
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 200;
}
.user-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 13px 11px;
}
.dropdown-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--green-text);
  flex-shrink: 0;
}
.dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dropdown-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
}
.dropdown-email {
  font-size: 10px;
  color: var(--t3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dropdown-divider {
  height: 0.5px;
  background: var(--border);
}
.dropdown-list {
  list-style: none;
  padding: 5px;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--t2);
  transition: background var(--t), color var(--t);
  outline: none;
}
.dropdown-item svg {
  color: var(--t3);
  flex-shrink: 0;
  transition: color var(--t);
}
.dropdown-item:hover {
  background: var(--s2);
  color: var(--t1);
}
.dropdown-item:hover svg {
  color: var(--t2);
}
.dropdown-item--danger {
  color: rgba(255, 92, 92, 0.7);
}
.dropdown-item--danger svg {
  color: rgba(255, 92, 92, 0.45);
}
.dropdown-item--danger:hover {
  background: rgba(255, 92, 92, 0.08);
  color: var(--danger);
}
.dropdown-item--danger:hover svg {
  color: var(--danger);
}

/* =========================================
   MAIN
   ========================================= */
.main {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 14px calc(var(--bottom-h) + 20px);
  box-sizing: border-box;
  overflow-x: hidden;
}

/* =========================================
   SEARCH
   ========================================= */
.search-section {
  margin-bottom: 16px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 13px;
  color: var(--t3);
  pointer-events: none;
  flex-shrink: 0;
  transition: color var(--t);
}
.search-input {
  width: 100%;
  height: 42px;
  padding: 0 44px 0 40px;
  background: var(--s2);
  border: 0.5px solid var(--border);
  border-radius: 100px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--t1);
  outline: none;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  -webkit-appearance: none;
}
.search-input::placeholder {
  color: var(--t3);
}
.search-input:hover {
  border-color: var(--border-h);
}
.search-input:focus {
  border-color: rgba(127, 204, 0, 0.45);
  background: var(--s3);
  box-shadow: 0 0 0 3px rgba(127, 204, 0, 0.1);
}
.search-input:focus ~ .search-icon,
.search-wrap:focus-within .search-icon {
  color: var(--green);
}

/* cancel/spinner — botones a la derecha del input */
.search-spinner,
.search-clear {
  position: absolute;
  right: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t3);
}
.search-spinner[hidden],
.search-clear[hidden] {
  display: none;
}
.search-clear {
  padding: 4px;
  border-radius: 50%;
  transition: color var(--t), background var(--t);
}
.search-clear:hover {
  color: var(--t1);
  background: var(--s4);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.spin {
  animation: spin 0.75s linear infinite;
}

/* =========================================
   ALPHABET
   ========================================= */
.alpha-section {
  margin-bottom: 20px;
}

.alpha-label {
  font-size: 10px;
  color: var(--t3);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-left: 2px;
}

.alpha-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.alpha-btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  margin-left: 2px;
  color: var(--t2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.alpha-btn:hover {
  background: var(--s3);
  border-color: var(--border-h);
  color: var(--t1);
}
.alpha-btn.active {
  background: rgba(127, 204, 0, 0.12);
  border-color: rgba(127, 204, 0, 0.35);
  color: var(--green);
}

.pagination-section {
  padding: 15px 0;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}
.pagination-count {
  margin: 0 7px;
}

/* =========================================
   RESULTS
   ========================================= */
.results-section {
  min-height: 200px;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
.empty-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--s2);
  border: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  color: var(--t3);
}
.empty-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--t2);
}
.empty-sub {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.6;
  max-width: 280px;
}

/* Skeleton */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}
.skeleton-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: var(--r);
}
@keyframes shimmer {
  0% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 0.35;
  }
}
.sk-num {
  width: 16px;
  height: 10px;
  background: var(--s3);
  border-radius: 4px;
  flex-shrink: 0;
  animation: shimmer 1.4s ease-in-out infinite;
}
.sk-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sk-title {
  height: 12px;
  background: var(--s3);
  border-radius: 4px;
  width: 60%;
  animation: shimmer 1.4s ease-in-out infinite;
  animation-delay: 0.1s;
}
.sk-sub {
  height: 10px;
  background: var(--s3);
  border-radius: 4px;
  width: 35%;
  animation: shimmer 1.4s ease-in-out infinite;
  animation-delay: 0.2s;
}
.sk-dur {
  width: 28px;
  height: 10px;
  background: var(--s3);
  border-radius: 4px;
  flex-shrink: 0;
  animation: shimmer 1.4s ease-in-out infinite;
  animation-delay: 0.15s;
}

/* Results header */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 10px;
}
.results-header[hidden] {
  display: none;
}
.results-label {
  font-size: 12px;
  color: var(--t3);
}
.results-count {
  font-size: 11px;
  color: var(--green);
  background: rgba(127, 204, 0, 0.1);
  border: 0.5px solid rgba(127, 204, 0, 0.2);
  padding: 2px 8px;
  border-radius: 100px;
}

/* Song list */
.song-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.song-list[hidden] {
  display: none;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--r);
  cursor: pointer;
  border: 0.5px solid transparent;
  transition: background var(--t), border-color var(--t);
  animation: itemIn 0.25s ease both;
}
@keyframes itemIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.song-item:hover {
  background: var(--s2);
  border-color: var(--border);
}
.song-item:active {
  background: var(--s3);
}

.song-num {
  font-size: 11px;
  color: var(--t3);
  width: 18px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.song-info {
  flex: 1;
  min-width: 0;
}
.song-title {
  font-size: 14px;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.song-artist {
  font-size: 11px;
  color: var(--t3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-dur {
  font-size: 11px;
  color: var(--t3);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.song-arrow {
  color: var(--t3);
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--t), transform var(--t);
}
.song-item:hover .song-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* No results */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
  color: var(--t3);
}
.no-results[hidden] {
  display: none;
}
.no-results p {
  font-size: 15px;
  font-weight: 500;
  color: var(--t2);
}
.no-results span {
  font-size: 13px;
  color: var(--t3);
}

/* =========================================
   BOTTOM NAV
   ========================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-h);
  background: var(--s1);
  border-top: 0.5px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 90;
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
  transition: background var(--t);
  color: var(--t3);
  text-decoration: none;
}
.bnav-item:hover {
  background: rgba(255, 255, 255, 0.03);
}
.bnav-item.active {
  color: var(--green);
}
.bnav-item span {
  font-size: 10px;
  font-weight: 500;
}
.bnav-item svg {
  transition: color var(--t);
}

/* Dot indicador en Player cuando hay canción cargada */
.bnav-dot {
  position: absolute;
  top: 8px;
  right: calc(50% - 14px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.bnav-dot[hidden] {
  display: none;
}

/* ─── TÍTULO MOBILE CATÁLOGO ──────────────────────────────── */
.catalogo-mobile-title {
  font-size: 20px;
  font-weight: 800;
  color: #a7ff1b;
  margin-bottom: 14px;
  letter-spacing: -0.3px;
  text-align: center;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (min-width: 480px) {
  .catalogo-mobile-title {
    display: none;
  }
  .main {
    padding: 20px 20px calc(var(--bottom-h) + 24px);
  }
  .search-input {
    height: 44px;
  }
  .alpha-btn {
    width: 32px;
    height: 32px;
  }
}

@media (min-width: 768px) {
  .main {
    padding: 28px 32px calc(var(--bottom-h) + 28px);
  }
  .user-email {
    max-width: 200px;
  }
}

/* Autofill override */
input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #1c1c1c inset;
  -webkit-text-fill-color: #fff;
}

::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--s3);
  border-radius: 2px;
}
