/* ===================================================
   YouTube 2015 — historial.css  (v3 - unificado)
   =================================================== */

/* ── Header ── */
.history-header,
.history-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}
.history-page-header .section-title { margin:0; border:none; padding:0; }

.history-clear-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; background: none;
  border: 1px solid #d0d0d0; border-radius: 2px;
  font-size: 12px; color: #555; cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.history-clear-btn:hover { background: #f5f5f5; border-color: #aaa; }
.history-clear-btn i { font-size: 11px; color: #888; }

/* ── Grupos por día ── */
.history-day-group { margin-bottom: 24px; }
.history-day-label {
  font-size: 12px; font-weight: 500; color: #909090;
  text-transform: uppercase; letter-spacing: .6px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border-color); margin-bottom: 8px;
}
.history-day-items { display: flex; flex-direction: column; }

/* ── Wrappers ── */
.history-page  { width: 100%; max-width: 720px; }
.history-list  { display: flex; flex-direction: column; width: 100%; }

/* ── Card unificada (historial.html + SPA) ── */
.history-card,
.history-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 8px;
  padding-right: 40px;     /* espacio para botón X */
  cursor: pointer;
  position: relative;
  transition: background .1s;
  border-bottom: 1px solid #f0f0f0;
  width: 100%;
  box-sizing: border-box;
}
.history-card:hover,
.history-item:hover { background: #f9f9f9; }

.history-card:hover .history-remove-btn,
.history-item:hover .history-remove { opacity: 1; }

.history-card:hover .history-title,
.history-item:hover .history-title { color: var(--yt-blue); }

/* ── Thumbnail ── */
.history-thumb {
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  height: 90px;          /* altura fija en vez de aspect-ratio — más compatible */
  background: #e0e0e0;
  background-size: cover;
  background-position: center;
  border-radius: 1px;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  display: block;
}
.history-thumb .video-duration,
.history-duration {
  position: absolute; bottom: 3px; right: 3px;
  background: rgba(0,0,0,.85); color: #fff;
  font-size: 11px; font-weight: 500; padding: 1px 4px;
  border-radius: 2px; pointer-events: none;
}

/* ── Info ── */
.history-info {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
  overflow: hidden;
}
.history-title {
  font-size: 13px; font-weight: 500; color: #212121;
  line-height: 1.4; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.history-channel {
  font-size: 12px; color: #606060; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-time { font-size: 11px; color: #aaa; }

/* ── Botón eliminar — SIEMPRE OCULTO hasta hover ── */
.history-remove-btn,
.history-remove {
  position: absolute; top: 50%; right: 6px;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  background: none; border: none; border-radius: 50%;
  color: #888; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;                /* OCULTO por defecto */
  transition: background .1s, opacity .15s;
  cursor: pointer;
}
.history-remove-btn:hover,
.history-remove:hover { background: #e0e0e0; color: #333; }

@keyframes slideOut {
  to { opacity:0; max-height:0; padding:0; margin:0; overflow:hidden; }
}
.history-card.removing { animation: slideOut .2s ease forwards; }

/* ── Modal confirmación ── */
.confirm-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
}
.confirm-box {
  background: #fff; border-radius: 2px; padding: 24px 28px;
  max-width: 360px; width: 90%; box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.confirm-box p { font-size: 14px; color: #212121; margin-bottom: 20px; line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.confirm-cancel {
  padding: 7px 16px; background: none; cursor: pointer;
  border: 1px solid #d0d0d0; border-radius: 2px; font-size: 12px; color: #555;
}
.confirm-cancel:hover { background: #f5f5f5; }
.confirm-ok {
  padding: 7px 16px; background: var(--yt-red); cursor: pointer;
  border: none; border-radius: 2px; font-size: 12px; font-weight: 500; color: #fff;
}
.confirm-ok:hover { background: var(--yt-red-hover); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .history-thumb { width: 110px; min-width: 110px; max-width: 110px; }
  .history-title { font-size: 12px; }
}