/* =========================================
   NEXTGEN DUBZ - HISTORY PAGE CSS
========================================= */

.history-page {
  max-width: 1450px;
  margin: 120px auto 60px auto;
  padding: 0 4vw;
  min-height: 60vh;
}
@media (min-width: 1600px) { .history-page { padding: 0 5vw; } }

/* --- HEADER SECTION --- */
.history-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 15px;
  flex-wrap: wrap;
}

.history-header h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  color: #fff;
}

.title-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}
.title-icon .svg-icon svg { width: 24px; height: 24px; color: #fff !important; }

.clear-btn { margin-left: auto; color: #ef4444 !important; border-color: rgba(239, 68, 68, 0.3) !important; }
.clear-btn:hover { background: rgba(239, 68, 68, 0.15) !important; border-color: rgba(239, 68, 68, 0.5) !important; }
.clear-btn .svg-icon svg { color: #ef4444 !important; }

/* --- YOUTUBE STYLE GRID (16:9) --- */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px 20px;
}

.yt-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  transition: transform 0.3s ease;
  cursor: pointer;
  background: transparent;
}

.yt-card:hover { transform: translateY(-4px); }

.yt-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9; /* Perfect YouTube Thumbnail Size */
  border-radius: 12px;
  overflow: hidden;
  background: rgba(20, 20, 22, 0.4);
  border: 1px solid var(--glass-border);
}

.yt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.yt-card:hover .yt-thumb { border-color: #8b5cf6; box-shadow: 0 10px 20px rgba(139, 92, 246, 0.25); }
.yt-card:hover .yt-thumb img { transform: scale(1.05); }

.yt-ep-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  z-index: 2;
}

.yt-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.yt-play-overlay .svg-icon svg {
  width: 50px;
  height: 50px;
  color: #ffffff !important;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.9));
  transform: scale(0.6);
  transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.yt-card:hover .yt-play-overlay { opacity: 1; }
.yt-card:hover .yt-play-overlay .svg-icon svg { transform: scale(1); }

.yt-info { display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.yt-title { font-size: 15px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; color: #fff; }
.yt-sub { font-size: 13px; color: #a1a1aa; font-weight: 500; }

/* --- EMPTY STATE --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
}
.empty-state h2 { font-size: 24px; margin: 0 0 10px 0; color: #fff; }
.empty-state p { color: #a1a1aa; max-width: 400px; margin: 0; line-height: 1.6; }

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
  .history-header { gap: 10px; margin-bottom: 20px; }
  .history-header h1 { font-size: 22px; }
  .title-icon { width: 38px; height: 38px; border-radius: 10px; }
  .title-icon .svg-icon svg { width: 20px; height: 20px; }
  .clear-btn { padding: 8px 16px; font-size: 13px; }
  
  .history-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px 15px; }
}

@media (max-width: 480px) {
  .history-page { margin-top: 100px; }
  .history-grid { grid-template-columns: 1fr; } /* Single column on very small phones */
  .clear-btn { margin-left: 0; width: 100%; justify-content: center; margin-top: 10px; }
}