/* Modern, clean UI for YouTube Playlist Plugin */

.ycp-playlist-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 20px 0;
}

.ycp-video-item {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
}

.ycp-video-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.ycp-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #f0f0f0;
  overflow: hidden;
}

.ycp-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.ycp-video-item:hover .ycp-thumbnail img {
  transform: scale(1.05);
}

.ycp-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(237, 33, 36, 0.9);
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  box-shadow: 0 4px 15px rgba(237, 33, 36, 0.4);
}

.ycp-play-btn svg {
  width: 32px;
  height: 32px;
  margin-left: 4px; /* Optical optical centering for play triangle */
}

.ycp-video-item:hover .ycp-play-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.ycp-content {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.ycp-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Modal Styling */
.ycp-modal {
  display: none;
  position: fixed;
  z-index: 999999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

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

.ycp-modal-content {
  position: relative;
  width: 90%;
  max-width: 1000px;
  background: #000;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: visible;
  z-index: 2;
  animation: ycp-modal-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ycp-modal-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ycp-player-container {
  position: relative;
  padding-top: 56.25%;
  border-radius: 16px;
  overflow: hidden;
}

.ycp-player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.ycp-close {
  position: absolute;
  top: -48px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0;
}

.ycp-close:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .ycp-playlist-container {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .ycp-close {
    top: -40px;
  }
}
