/* Container Principal e Grade */
.ytm-section {
  position: relative;
  margin-top: 35px;
  margin-bottom: 32px;
}

.ytm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ytm-header-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ytm-play-all-btn {
  background-color: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 7px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.ytm-play-all-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.ytm-nav-btns {
  display: flex;
  gap: 8px;
}

.ytm-nav-btns button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 21px;
}

.ytm-nav-btns button:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.1);
}

.ytm-nav-btns button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ytm-grid {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: 350px;
  /* Largura de cada item na grade */
  gap: 4px 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  scrollbar-width: none;
  /* Firefox */
}

.ytm-grid::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

/* Item da Lista (Música) */
.ytm-item {
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s;
  cursor: pointer;
  position: relative;
}

.ytm-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.ytm-cover-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  margin-right: 16px;
}

.ytm-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Overlay e Ícones da Capa */
.ytm-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.ytm-overlay i {
  color: #fff;
  font-size: 24px;
  display: none;
}

/* Estado Padrão (Sem tocar, Hover = Mostra Play) */
.ytm-item:not(.is-playing):not(.is-paused):hover .ytm-overlay {
  opacity: 1;
}

.ytm-item:not(.is-playing):not(.is-paused):hover .icon-play {
  display: block;
}

/* Estado Tocando (Sempre visível = Mostra Volume, Hover = Mostra Pause) */
.ytm-item.is-playing .ytm-overlay {
  opacity: 1;
}

.ytm-item.is-playing .icon-volume {
  display: block;
}

.ytm-item.is-playing:hover .icon-volume {
  display: none;
}

.ytm-item.is-playing:hover .icon-pause {
  display: block;
}

/* Estado Pausado (Música atual parada = Mostra Play) */
.ytm-item.is-paused .ytm-overlay {
  opacity: 1;
}

.ytm-item.is-paused .icon-play {
  display: block;
}

/* Informações da Música */
.ytm-info {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ytm-title {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.ytm-artist {
  color: #aaa;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ações Direitas (Like, Deslike, Menu) */
.ytm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.ytm-item:hover .ytm-actions {
  opacity: 1;
}

.ytm-action-btn {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
}

.ytm-action-btn:hover {
  color: #fff;
}

/* Modificadores para Artistas (Redondo) */
.ytm-item.is-artist .ytm-cover-wrapper {
  border-radius: 50%;
}

.ytm-item.is-artist .ytm-overlay {
  border-radius: 50%;
}

/* Ocultar ícones desnecessários em Artistas e Playlists */
.ytm-item.is-artist .icon-pause,
.ytm-item.is-artist .icon-volume,
.ytm-item.is-playlist .icon-pause,
.ytm-item.is-playlist .icon-volume {
  display: none !important;
}

/* Garantir que playlists/artistas sempre mostrem o play no hover e não tentem puxar estado do áudio */
.ytm-item.is-artist:hover .ytm-overlay,
.ytm-item.is-playlist:hover .ytm-overlay {
  opacity: 1;
}

.ytm-item.is-artist:hover .icon-play,
.ytm-item.is-playlist:hover .icon-play {
  display: block;
}

/* --- Cards da Comunidade (Estilo YTM) --- */
.ytm-community-card {
  background: linear-gradient(145deg, #2a2220 0%, #1a1514 100%);
  border-radius: 16px;
  padding: 16px;
  min-width: 340px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.ytm-community-card:hover {
  background: linear-gradient(145deg, #352a28 0%, #221c1a 100%);
}

/* Cabeçalho do Card (Capa e Títulos) */
.ytm-cc-header {
  display: flex;
  gap: 16px;
  align-items: center;
}

.ytm-cc-cover {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.ytm-cc-meta h3 {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: -webkit-box;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ytm-cc-meta p {
  margin: 0;
  font-size: 0.85rem;
  color: #aaa;
}

/* Descrição */
.ytm-cc-desc {
  font-size: 0.85rem;
  color: #bbb;
  margin: 0;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Lista de Músicas (Preview) */
.ytm-cc-tracks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ytm-cc-track {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ytm-cc-track img {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
}

.ytm-cc-track-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ytm-cc-track-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #eaeaea;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ytm-cc-track-artist {
  font-size: 0.8rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ytm-cc-track i {
  color: #888;
}

/* Botões do Rodapé */
.ytm-cc-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.ytm-cc-btn-play {
  background: #fff;
  color: #000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.1s;
}

.ytm-cc-btn-play:hover {
  transform: scale(1.05);
}

.ytm-cc-btn-icon {
  background: transparent;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 1.1rem;
}

.ytm-cc-btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}