:root {
  --bg: #fafbfc;
  --fg: #1e1e28;
  --muted: #6b6b78;
  --brand: #0d6efd;
  --accent: #ff4d6d;
  --card: #ffffff;
  --line: #e7e7ef;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overflow-x: hidden;
  background: #ffffff;
  color: var(--fg);
  font:
    16px/1.5 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Ubuntu,
    "Helvetica Neue",
    Arial;
}

/* Ocultar elementos mobile-only no desktop */
.mobile-only {
  display: none !important;
}

/* Habilitar rolagem vertical no mobile */
@media (max-width: 980px) {
  html,
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  gap: 12px;
  padding: 20px 20px 10px 20px;
  align-items: stretch;
  box-sizing: border-box;
}

.section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  height: 100%;
  overflow: hidden;
}

/* Proporções das colunas: player 40%, pedidos 60% */
.section.player {
  flex: 0 0 40%;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.section.requests {
  flex: 0 0 59%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 8px;
  overflow: hidden;
}

/* CARD topo acima do player */
.station-card {
  position: relative;
  width: 100%;
  padding: 21px 19px;
  border-radius: 15px;
  /* background: rgb(20, 81, 145); */
  background: linear-gradient(140deg, #009cd1, #7242dd, #0e549d);
  color: #fff;
  overflow: hidden;
  /* box-shadow: 0 28px 46px -32px rgba(67, 56, 202, 0.6); */
  isolation: isolate;
  min-height: 190px; /* Altura mínima para desktop */
}
.station-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 120% at 100% 0%,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  pointer-events: none;
  z-index: -1;
}
.station-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

/* Desktop: Reposicionar badge para o bottom direito */
@media (min-width: 768px) {
  .station-card {
    position: relative;
  }

  .station-card__badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
  }
}

/* Garantir que o status-pill fique alinhado à direita */
.station-card__header .status-pill {
  margin-left: auto;
}

.station-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin: 0px 0px 7px 0px;
}
.station-card__pulse {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.9);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  from {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.9);
  }
  to {
    box-shadow: 0 0 0 12px rgba(52, 211, 153, 0);
  }
}

.station-card .title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px 0;
  font-weight: 700;
  letter-spacing: 0.4px;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  color: #fff;
}
.station-card .subtitle {
  margin: 0 0 0px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}
.station-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

/* ===== GLOBAL STATUS PILL (FIXED TOP-RIGHT) ===== */
.global-status-pill {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-block;
  padding: 8px 12px;
  background: rgba(127, 0, 223, 0.85);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* backdrop-filter: blur(12px); */
  /* box-shadow: */
  /* 0 4px 16px rgba(0, 0, 0, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.2); */
  /* text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); */
}

.station-card .links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.station-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.lang-switch {
  position: relative;
}
.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(127, 0, 223, 0.85);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-switch__btn:hover {
  background: rgba(127, 0, 223, 0.95);
  transform: translateY(-1px);
}
.lang-switch__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: saturate(120%) blur(8px);
  color: #111;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  display: none;
  min-width: 130px;
  z-index: 15;
}
.lang-switch__menu.is-open {
  display: block;
}
.lang-switch__menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.lang-switch__menu button:hover {
  background: #eef2ff;
}
.station-card__cta svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.station-card__cta:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -18px rgba(15, 23, 42, 0.6);
}

/* iframes - apenas para histórico */
iframe {
  border: 0;
  border-radius: 6px;
  background: #fff;
}

/* ========== LISTA DE PEDIDOS ========== */
#pedidos-container {
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  margin-bottom: 5px;
  overflow: hidden;
  position: relative; /* Para posicionamento absoluto dos elementos internos */
}

#lista-pedidos {
  flex-grow: 1;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
}

.scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: rgba(13, 110, 253, 0.08);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  pointer-events: none;
  animation: blink 2s infinite;
}

.scroll-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-hint.is-hidden {
  opacity: 0;
  transform: translateY(-6px);
}

.scroll-hint__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 1rem;
  font-weight: bold;
  animation: bounce 1.5s infinite;
}

.scroll-hint__icon--left {
  order: -1;
}

.scroll-hint__icon--right {
  order: 1;
}

/* Animação de piscar para o scroll-hint */
@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0.6;
  }
}

/* Animação de bounce para as setas */
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-4px);
  }
  60% {
    transform: translateY(-2px);
  }
}

#loading-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 1rem;
}

.pedido-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.2s ease;
  border-radius: 6px;
  margin-bottom: 3px;
}

.pedido-item:hover {
  background-color: #f8f9fa;
}

.pedido-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.media-shell {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f2f5;
}

.media-shell--history {
  width: 44px;
  height: 44px;
}

.image-skeleton {
  position: absolute;
  inset: 0;
  background: #edeff6;
  overflow: hidden;
}

.image-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.image-skeleton.is-hidden {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-media {
  opacity: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transition: opacity 0.35s ease;
  display: block;
}

.lazy-media.is-visible {
  opacity: 1;
}

.pedido-cover,
.history-cover {
  width: 100%;
  height: 100%;
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-skeleton::after {
    animation: none;
  }

  .lazy-media {
    transition: none;
  }
}

.pedido-info {
  flex: 1;
  min-width: 0;
}

.pedido-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--fg);
  margin: 0 0 1px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pedido-artist {
  color: var(--muted);
  font-size: 0.75rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pedido-button {
  background: var(--brand);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  touch-action: manipulation; /* Previne zoom no foco */
}

.pedido-button:hover {
  background: #0b5ed7;
  transform: translateY(-1px);
}

.pedido-button:active {
  transform: translateY(0);
}

.pedido-button:disabled {
  background: var(--muted);
  cursor: not-allowed;
  transform: none;
}

#toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  max-width: 320px;
  padding: 14px 18px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 20px 40px -24px rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transform: translateY(12px);
  opacity: 0;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
  pointer-events: auto;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 0.9rem;
}

.toast__message {
  flex: 1;
  line-height: 1.4;
}

.toast__close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.toast__close:hover {
  opacity: 1;
}

.toast--success {
  background: linear-gradient(135deg, #22c55e, #15803d);
}

.toast--error {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.toast--info {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

@media (max-width: 720px) {
  #toast-container {
    right: 12px;
    left: 12px;
    bottom: 12px;
    align-items: flex-end;
  }

  .toast {
    width: 100%;
    max-width: none;
  }
}

/* Estilos para busca */
.search-container input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Ocultar elementos mobile-only no desktop */
.mobile-only {
  display: none !important;
}

/* Mostrar elementos desktop-only apenas no desktop */
.desktop-only {
  display: inline-block;
}

/* ========== LAYOUT RESPONSIVO MOBILE ========== */
@media (max-width: 980px) {
  /* Mobile: busca em largura total */
  .search-container {
    width: 100% !important;
  }

  .search-container input {
    font-size: 16px; /* Evita zoom no iOS */
    touch-action: manipulation; /* Previne zoom no foco */
  }

  /* Container principal mobile */
  .container {
    flex-direction: column;
    padding: 12px;
    min-height: 100vh;
    width: 100vw;
    gap: 6px;
    overflow: visible;
  }

  .section {
    align-items: center;
  }

  /* ===== SEÇÃO PLAYER MOBILE ===== */
  .section.player {
    flex: 0 0 auto;
    height: auto;
    min-height: auto;
  }

  /* Ocultar pill global fixo no mobile */
  .global-status-pill:not(.mobile-only) {
    display: none;
  }

  /* Header dos pedidos - organizar h2 e elementos mobile na mesma linha */
  .requests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0px;
  }

  /* Ocultar elementos desktop-only no mobile */
  .desktop-only {
    display: none !important;
  }

  /* Mostrar pill mobile apenas no mobile */
  .mobile-only {
    display: flex !important;
    position: static;
    top: auto;
    right: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    justify-content: flex-start;
  }

  .status-pill {
    font-size: 0.75rem;
    padding: 6px 20px;
  }

  .lang-switch__btn {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  /* Player mobile - altura otimizada - estilos movidos para css/player.css */

  /* Ocultar histórico da seção player no mobile */
  .section.player #historyTitle,
  .section.player #song-history {
    display: none;
  }

  /* Mostrar apenas a versão mobile do histórico na seção requests */
  .mobile-only {
    display: block !important;
  }

  /* Correção específica para o histórico mobile - evitar sobreposição */

  /* ===== ACCORDION HISTÓRICO MOBILE ===== */
  .history-accordion {
    margin: 5px 0 0 0;
    width: 100%;
  }

  .accordion-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    margin: 0 !important;
    width: 100%;
    box-sizing: border-box;
    z-index: 10;
    position: relative;
  }

  .accordion-header:hover {
    background: #f1f2f4;
  }

  .accordion-header:focus {
    /* outline: 2px solid #007bff;
    outline-offset: 2px; */
  }

  .accordion-icon {
    transition:
      transform 0.3s ease,
      color 0.3s ease;
    color: #6c757d;
    width: 20px;
    height: 20px;
  }

  /* Back-and-forth 90-degree rotation animation to indicate interactivity */
  @keyframes rotate-hint-90 {
    0% {
      transform: rotate(-90deg);
    }
    50% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(-90deg);
    }
  }

  /* Stop animation when accordion is expanded */
  .accordion-header[aria-expanded="true"] .accordion-icon {
    animation: none;
  }

  /* Hover effect for better interactivity indication */
  .accordion-header:hover .accordion-icon {
    color: #495057;
    animation: none;
    transform: rotate(-90deg) scale(1.1);
  }

  /* Default state and animation for closed accordion */
  .accordion-header[aria-expanded="false"] .accordion-icon {
    transform: rotate(-90deg);
    animation: rotate-hint-90 2.5s ease-in-out infinite;
  }

  /* Tap to open hint styles */
  .tap-to-open-hint {
    font-size: 0.75rem;
    color: #6c757d;
    margin-left: auto;
    margin-right: 8px;
    opacity: 0;
    animation: pulse-fade-in 2s ease-in-out infinite;
    white-space: nowrap;
    font-weight: 400;
  }

  /* Pulse fade in animation */
  @keyframes pulse-fade-in {
    0% {
      opacity: 0;
      transform: scale(0.95);
    }
    50% {
      opacity: 0.7;
      transform: scale(1);
    }
    100% {
      opacity: 0;
      transform: scale(0.95);
    }
  }

  /* Hide hint when accordion is expanded */
  .accordion-header[aria-expanded="true"] .tap-to-open-hint {
    display: none;
  }

  .accordion-content {
    overflow: hidden;
    transition:
      max-height 0.3s ease,
      opacity 0.3s ease,
      padding 0.3s ease;
    max-height: 600px;
    opacity: 1;
  }

  .accordion-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
  }

  #song-history-mobile {
    display: block !important;
    position: relative;
    z-index: 1;
    margin-top: 8px !important;
    clear: both;
    /* padding-bottom: 120px; Espaço aumentado para rodapé fixo + margem extra */
  }

  /* Quando o accordion está fechado, remove o padding do conteúdo */
  #song-history-mobile.collapsed {
    display: none !important;
    padding: 0 !important;
    padding-bottom: 0 !important;
    height: 0;
    overflow: hidden;
  }

  /* ===== SEÇÃO REQUESTS MOBILE ===== */
  .section.requests {
    flex: 1;
    width: 100%;
    padding-bottom: 60px; /* Espaço para rodapé fixo */
    overflow: visible;
  }

  /* Container de pedidos mobile - altura maximizada com espaço para rodapé */
  #pedidos-container {
    flex: 1;
    width: 100%;
    margin-bottom: 0;
    min-height: 60vh; /* Altura mínima para mostrar mais músicas */
    max-height: calc(
      100vh - 200px
    ); /* Altura máxima considerando header e rodapé */
    /* Estilização customizada mobile */
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #ffffff;
    padding: 12px;
    overflow-y: auto; /* Permite scroll vertical */
    overflow-x: hidden; /* Mantém scroll horizontal oculto */
    display: flex;
    flex-direction: column;
  }

  /* Ajustes dos itens de pedido no mobile */
  .pedido-item {
    padding: 5px;
    gap: 6px;
    margin-bottom: 2px;
  }

  .pedido-title {
    font-size: 0.8rem;
  }

  .pedido-artist {
    font-size: 0.7rem;
  }

  .pedido-button {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  /* Card da estação mobile */
  .station-card {
    padding: 22px;
    border-radius: 16px;
    margin-bottom: 6px;
    min-height: 160px; /* Altura mínima para mobile */
  }
  .station-card__header {
    justify-content: flex-start;
    gap: 10px;
  }

  .station-card__meta {
    margin-bottom: 16px;
    gap: 6px;
  }
  .station-card__cta {
    width: 100%;
    justify-content: center;
  }

  .media-shell {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
}

/* ===== MOBILE PEQUENO (< 520px) ===== */
@media (max-width: 520px) {
  .container {
    padding: 12px;
    gap: 4px;
  }

  /* Estilos do .horizontal-player movidos para css/player.css */

  .station-card {
    padding: 18px;
    min-height: 150px; /* Altura mínima para mobile pequeno */
  }

  .station-card .subtitle {
    font-size: 0.85rem;
  }
  /* CSS dos pills removido - não são mais utilizados */

  #pedidos-container {
    flex: 1;
    min-height: 50vh; /* Altura mínima para telas muito pequenas */
    max-height: calc(100vh - 180px); /* Altura máxima para telas pequenas */
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
    padding: 10px;
    overflow-y: auto; /* Permite scroll vertical */
    overflow-x: hidden; /* Mantém scroll horizontal oculto */
    display: flex;
    flex-direction: column;
  }

  .pedido-item {
    padding: 6px;
    gap: 6px;
  }

  .media-shell,
  .media-shell--history {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .pedido-button {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
}

/* ========== SELO DE STREAMING ========== */
/* Selo desktop: div sequencial após o histórico de música */
.stamp {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.6);
  /* backdrop-filter: saturate(120%) blur(4px); */
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 8px 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  /* box-shadow: 0 2px 8px rgba(0,0,0,0.1); */
  transition: all 0.3s ease;
  margin: 0px 0;
}

/* Selo mobile: rodapé fixo após pedidos musicais */
@media (max-width: 980px) {
  .stamp {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    padding: 12px 16px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: saturate(120%) blur(8px);
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    justify-content: center;
    z-index: 1001;
  }

  .stamp.show {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Removido CSS que estava ocultando elementos incorretamente */
.stamp strong {
  color: var(--fg);
  font-weight: 700;
}
.wa {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.65rem;
}
.wa:hover {
  filter: brightness(1.05);
}
.wa svg {
  width: 12px;
  height: 12px;
  fill: #fff;
}

/* ===== HISTÓRICO DE MÚSICAS ===== */
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.2s ease;
  border-radius: 6px;
  margin-bottom: 3px;
}

.history-item:hover {
  background-color: #f8f9fa;
}

.history-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.history-cover {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  margin-right: 0; /* Removido margin-right pois usamos gap no container */
  flex-shrink: 0;
  background: #f5f5f5;
}

.history-info {
  flex: 1;
  min-width: 0;
}

.history-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 5px; /* Espaçamento otimizado entre título e artista */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.history-artist {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 6px; /* Espaçamento otimizado entre artista e tempo */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.history-time {
  font-size: 0.75rem;
  color: #999;
  font-style: italic;
  line-height: 1.3;
}

/* ===== ESTILOS PARA TÍTULOS ===== */
#historyTitle,
#historyTitleMobile {
  margin: 8px 0 6px;
  font-size: 1.15rem;
  color: #333;
  text-align: left;
  width: 100%;
  padding: 5px 10px;
}

#requestsTitle {
  margin: 4px 0 0px;
  font-size: 1.15rem;
  color: #333;
  text-align: left;
  width: 100%;
  padding: 0px 9px;
}

/* ===== ESTILOS PARA CONTAINERS DE HISTÓRICO ===== */
#song-history,
#song-history-mobile {
  width: 100%;
  min-height: 300px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e7e7ef;
  flex: 1; /* Ocupa todo o espaço disponível */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Ajuste específico para mobile - altura mínima aumentada para 5 cards */
@media (max-width: 980px) {
  #song-history-mobile {
    min-height: 390px; /* Altura mínima aumentada para acomodar 5 cards */
  }
}

/* Ajuste específico para mobile - altura máxima considerando rodapé fixo */
@media (max-width: 980px) {
  #song-history-mobile {
    max-height: calc(
      100vh - 50px
    ); /* Altura máxima otimizada para mostrar mais cards */
  }
}

/* ===== ESTILOS PARA ESTADOS DE LOADING ===== */
#history-loading,
#history-loading-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #6b6b78;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== ESTILOS PARA ESTADOS DE ERRO ===== */
#history-error,
#history-error-mobile {
  display: none;
  padding: 20px;
  text-align: center;
  color: #ff4d6d;
  font-size: 0.9rem;
  line-height: 1.4;
}

#history-error button,
#history-error-mobile button {
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

#history-error button:hover,
#history-error-mobile button:hover {
  background: #e63946 !important;
}

/* ===== ESTILOS PARA LISTAS DE HISTÓRICO ===== */
#history-list,
#history-list-mobile {
  display: none;
  padding: 10px;
  flex: 1; /* Ocupa todo o espaço disponível dentro do song-history */
  height: 100%; /* Força ocupar toda a altura disponível */
  overflow-y: auto;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  gap: 6px;
}

/* ===== ESTILOS PARA BUSCA ===== */
.search-container {
  width: 100%;
  margin-bottom: 0px;
}

#search-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

/* ===== ESTILOS PARA MENSAGENS DE ERRO ===== */
#error-message {
  display: none;
  color: #dc3545;
  text-align: center;
  padding: 20px;
}

/* ===== ESTILOS PARA CONTADOR DE RESULTADOS ===== */
#results-counter {
  margin: 4px 0 2px 0;
  font-size: 13px;
  color: #666;
  text-align: center;
}

/* ===== CLASSES UTILITÁRIAS PARA JAVASCRIPT ===== */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #6b6b78;
}

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

.retry-button {
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.retry-button-history {
  margin-top: 10px;
  padding: 8px 16px;
  background: #ff4d6d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Garantir que sempre mostre exatamente 5 itens com altura otimizada */
.history-item {
  min-height: 72px; /* Altura mínima aumentada para acomodar padding maior */
  max-height: 72px; /* Altura máxima aumentada para melhor distribuição */
}

/* Skeleton loading para lista de pedidos */
.requests-skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 8px;
  z-index: 10;
  overflow-y: auto;
}

.request-skeleton-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: 72px;
}

.request-skeleton-cover {
  width: 48px;
  height: 48px;
  background: #edeff6;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.request-skeleton-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.request-skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.request-skeleton-title {
  height: 16px;
  background: #edeff6;
  border-radius: 4px;
  width: 65%;
  position: relative;
  overflow: hidden;
}

.request-skeleton-title::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.request-skeleton-artist {
  height: 14px;
  background: #edeff6;
  border-radius: 4px;
  width: 45%;
  position: relative;
  overflow: hidden;
}

.request-skeleton-artist::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.request-skeleton-button {
  width: 70px;
  height: 32px;
  background: #edeff6;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.request-skeleton-button::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

/* Skeleton loading para histórico */
.history-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.history-skeleton-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.history-skeleton-cover {
  width: 40px;
  height: 40px;
  background: #edeff6;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.history-skeleton-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.history-skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-skeleton-title {
  height: 16px;
  background: #edeff6;
  border-radius: 3px;
  width: 65%;
  position: relative;
  overflow: hidden;
}

.history-skeleton-title::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.history-skeleton-artist {
  height: 14px;
  background: #edeff6;
  border-radius: 3px;
  width: 45%;
  position: relative;
  overflow: hidden;
}

.history-skeleton-artist::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.history-skeleton-time {
  height: 12px;
  background: #edeff6;
  border-radius: 3px;
  width: 35%;
  position: relative;
  overflow: hidden;
}

.history-skeleton-time::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

/* Responsividade para mobile */
@media (max-width: 768px) {
  .request-skeleton-item {
    padding: 12px;
    gap: 12px;
  }

  .request-skeleton-cover {
    width: 50px;
    height: 50px;
  }

  .request-skeleton-button {
    width: 70px;
    height: 32px;
  }

  .history-skeleton-item {
    padding: 8px;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .request-skeleton-cover::after,
  .request-skeleton-title::after,
  .request-skeleton-artist::after,
  .request-skeleton-button::after,
  .history-skeleton-cover::after,
  .history-skeleton-title::after,
  .history-skeleton-artist::after,
  .history-skeleton-time::after {
    animation: none;
  }
}

/* Responsividade para telas menores */
@media (max-width: 980px) {
  .section.player {
    padding-bottom: 0px; /* Menos espaço para o stamp em mobile */
  }
}

@media (max-width: 600px) {
  .section.player {
    padding-bottom: 0px; /* Ainda menos espaço para telas muito pequenas */
  }
}

/* ===== MODAL DE CONEXÃO OFFLINE ===== */
.offline-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.offline-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.offline-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  padding: 32px 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 8px 16px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideUp 0.3s ease-out;
}

.offline-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.offline-modal-icon svg {
  width: 32px;
  height: 32px;
}

.offline-modal-content h3 {
  margin: 0 0 12px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  letter-spacing: -0.02em;
}

.offline-modal-content p {
  margin: 0 0 24px 0;
  font-size: 1rem;
  line-height: 1.5;
  color: #64748b;
}

.offline-modal-actions {
  display: flex;
  justify-content: center;
}

.offline-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #0d6efd, #0056b3);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.offline-retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
  background: linear-gradient(135deg, #0056b3, #004085);
}

.offline-retry-btn:active {
  transform: translateY(0);
}

.offline-retry-btn svg {
  width: 18px;
  height: 18px;
}

/* Animações */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsividade do modal */
@media (max-width: 480px) {
  .offline-modal-content {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .offline-modal-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
  }

  .offline-modal-icon svg {
    width: 28px;
    height: 28px;
  }

  .offline-modal-content h3 {
    font-size: 1.3rem;
  }

  .offline-modal-content p {
    font-size: 0.9rem;
  }

  .offline-retry-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}
