/* ================================= */
/* === LEJÁTSZÁSI LISTA STÍLUSOK === */
/* ================================= */

/* --- Gombok állapota --- */
/* ÚJ SZABÁLY: Alaphelyzetben elrejti a pipa ikont */
#add-to-playlist-button .icon-check {
  display: none;
}
/* ======================================= */
/* === ÚJ: EGYEDI POPUP ÉS HIBAJELZÉS === */
/* ======================================= */

/* --- Input hibaállapot és animáció --- */
.input-error {
  border: 1px solid var(--primary-color) !important;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}

/* ÚJ: Dedikált hibaüzenet stílusa */
.input-error-message {
  color: #ff6b81;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 15px 0 15px; /* Térköz a form felett és oldalt */
  text-align: center;
  display: none; /* Alapból rejtett */
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --- Egyedi megerősítő ablak (Confirm Dialog) --- */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1020; /* Legfelül kell lennie */
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.confirm-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.confirm-popup {
  background: rgba(25, 25, 25, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 25px 30px;
  width: 90%;
  max-width: 400px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.confirm-overlay.active .confirm-popup {
  transform: scale(1);
  opacity: 1;
}

.confirm-popup h4 {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.confirm-popup p {
  margin: 0 0 25px 0;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-dialog-actions button {
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}

.confirm-dialog-actions .button-secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}
.confirm-dialog-actions .button-secondary:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.confirm-dialog-actions .button-danger {
  background-color: #ff2d55;
  color: white;
}
.confirm-dialog-actions .button-danger:hover {
  filter: brightness(1.2);
}
.song-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 15px;
}

#add-to-playlist-button {
  width: 36px;
  height: 36px;
  font-size: 1rem;
  padding: 0;
  color: rgba(165, 165, 165, 0.7);
}

#add-to-playlist-button:hover {
  color: white;
}

#add-to-playlist-button.in-playlist .icon-plus {
  display: none;
}

#add-to-playlist-button.in-playlist .icon-check {
  display: inline-block;
  color: var(--primary-color);
}

/* --- Általános Overlay és Popup Stílusok --- */
.playlist-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1005;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.playlist-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.playlist-popup {
  background: rgba(18, 18, 18, 0.7);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 90%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.playlist-overlay.active .playlist-popup {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.playlist-popup-header {
  padding: 15px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.playlist-popup-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.popup-close-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}
.popup-close-btn:hover {
  color: white;
  transform: rotate(90deg);
}

/* --- "Hozzáadás listához" Modal Specifikus Stílusok --- */
#playlist-modal-overlay .playlist-popup {
  max-width: 400px;
}
#existing-playlists-modal-list {
  list-style: none;
  padding: 15px;
  margin: 0;
  max-height: 40vh;
  overflow-y: auto;
}
.playlist-modal-item {
  padding: 14px 20px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.playlist-modal-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* --- "Lejátszási listáim" Panel Stílusok --- */
.playlist-popup.large {
  max-width: 900px;
  height: 70vh;
  max-height: 650px;
}

.playlist-popup-content-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  height: 100%;
  overflow: hidden;
}

.playlist-list-container {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}
#my-playlists-list {
  list-style: none;
  padding: 10px;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}
.playlist-view-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.playlist-view-item.active {
  background-color: rgba(255, 45, 85, 0.15);
  font-weight: bold;
}
.playlist-view-item:not(.active):hover {
  background-color: rgba(255, 255, 255, 0.05);
}
.playlist-name {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playlist-item-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
}
.playlist-control-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.playlist-control-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}
.playlist-control-btn.delete-btn:hover {
  background-color: rgba(255, 45, 85, 0.2);
  color: #ff2d55;
}

.new-playlist-form-container {
  display: flex;
  padding: 15px;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
#new-playlist-name-panel {
  flex-grow: 1;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
}
#create-playlist-panel-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}
#create-playlist-panel-btn:hover {
  background-color: var(--primary-color);
}

.playlist-songs-container {
  display: flex;
  flex-direction: column;
}
#playlist-songs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}
.playlist-songs-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.4);
}
.playlist-song-item {
  display: flex;
  align-items: center;
  padding: 10px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.playlist-song-item img {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  margin-right: 15px;
}
.playlist-song-info {
  flex-grow: 1;
}
.playlist-song-info h4 {
  font-size: 0.95rem;
  margin: 0;
  font-weight: 500;
}
.playlist-song-info p {
  font-size: 0.8rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
}
.remove-song-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: all 0.2s;
}
.remove-song-btn:hover {
  color: #ff2d55;
  background-color: rgba(255, 45, 85, 0.15);
}

/* --- Kilépés gomb a fő nézeten --- */
.exit-playlist-button {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 45, 85, 0.2);
  border: 1px solid rgba(255, 45, 85, 0.4);
  color: #ff2d55;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}
.exit-playlist-button:hover {
  background: #ff2d55;
  color: white;
  transform: scale(1.1);
}

/* Scrollbar stílusok */
.playlist-list-container::-webkit-scrollbar,
.playlist-songs-container ul::-webkit-scrollbar,
#existing-playlists-modal-list::-webkit-scrollbar {
  width: 6px;
}
.playlist-list-container::-webkit-scrollbar-track,
.playlist-songs-container ul::-webkit-scrollbar-track,
#existing-playlists-modal-list::-webkit-scrollbar-track {
  background: transparent;
}
.playlist-list-container::-webkit-scrollbar-thumb,
.playlist-songs-container ul::-webkit-scrollbar-thumb,
#existing-playlists-modal-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}
/* ÚJ: Input hibaállapot és animáció */
.input-error {
  border: 1px solid var(--primary-color) !important;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}
