/* ── Video Library Styles (light theme, matches /tools/) ──── */

/* Index page header */
.video-library-header { padding: 100px 0 40px; text-align: center; }
.video-library-header h1 { font-size: 2.5rem; font-weight: 900; margin-bottom: 0.75rem; color: var(--text); }
.video-library-header .subtitle { font-size: 1.15rem; color: var(--text-secondary); max-width: 620px; margin: 0 auto; }

/* Search + Filter bar */
.video-controls { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.video-search {
  flex: 1; min-width: 220px; padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid var(--border); border-radius: 10px; font-size: 0.95rem;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%236b7280' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") no-repeat 0.75rem center;
  color: var(--text); outline: none; transition: border-color 0.2s; font-family: Inter, sans-serif;
}
.video-search:focus { border-color: var(--accent, #6366f1); }
.video-search::placeholder { color: var(--text-secondary); }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.filter-btn {
  background: var(--surface); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 0.5rem 1rem; font-size: 0.85rem; font-weight: 600;
  font-family: Inter, sans-serif; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.filter-btn:hover { border-color: var(--accent, #6366f1); color: var(--text); }
.filter-btn.active { background: var(--accent, #6366f1); color: #fff; border-color: var(--accent, #6366f1); }

/* Video count */
.video-count { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1rem; }

/* Video grid — index page */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.video-card {
  text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
  transition: all 0.25s; display: flex; flex-direction: column;
}
.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  border-color: var(--accent, #6366f1);
}
.card-thumb {
  position: relative; aspect-ratio: 16/9; overflow: hidden; background: #f1f5f9;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.duration-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.8); color: #fff;
  font-size: 0.75rem; font-weight: 600; padding: 2px 6px;
  border-radius: 4px; font-variant-numeric: tabular-nums;
}
.card-body { padding: 1rem; flex: 1; }
.card-body h3 {
  font-size: 0.95rem; font-weight: 700; line-height: 1.4;
  margin: 0.4rem 0 0.5rem; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-size: 0.8rem; color: var(--text-secondary); }

/* Badges */
.badge {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem; border-radius: 6px; white-space: nowrap;
}
.badge-tutorial { background: rgba(34,197,94,0.1); color: #16a34a; }
.badge-demo { background: rgba(99,102,241,0.1); color: var(--accent, #6366f1); }
.badge-feature { background: rgba(59,130,246,0.1); color: #2563eb; }
.badge-comparison { background: rgba(249,115,22,0.1); color: #ea580c; }
.badge-case-study { background: rgba(168,85,247,0.1); color: #9333ea; }
.badge-shorts { background: rgba(236,72,153,0.1); color: #db2777; }

/* Loading spinner for infinite scroll */
.load-more-sentinel { text-align: center; padding: 2rem 0; }
.load-spinner {
  display: inline-block; width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--accent, #6366f1);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.load-end { font-size: 0.9rem; color: var(--text-secondary); padding: 2rem 0; text-align: center; }

/* No results */
.no-results { text-align: center; padding: 4rem 1rem; color: var(--text-secondary); }

/* ── Individual video page ─────────────────────────────────── */
.video-page { max-width: 900px; padding-top: 100px; padding-bottom: 3rem; }
.video-header { margin-bottom: 1.5rem; }
.video-header h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin-top: 0.75rem; color: var(--text); }
.video-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: var(--text-secondary); }
.meta-sep::before { content: "\00b7"; margin-right: 0.6rem; }

/* Responsive video embed */
.video-embed {
  position: relative; width: 100%; padding-bottom: 56.25%;
  border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 2rem;
}
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Content section */
.video-content { font-size: 1.05rem; line-height: 1.75; color: var(--text-secondary); }
.video-content h2 { font-size: 1.35rem; font-weight: 700; color: var(--text); margin-top: 2rem; margin-bottom: 0.75rem; }
.takeaways { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.takeaways li { position: relative; padding-left: 1.75rem; margin-bottom: 0.6rem; }
.takeaways li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent, #6366f1); font-weight: 700; }

/* Related videos */
.related-videos { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.related-videos h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--text); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.related-card { text-decoration: none; color: var(--text); transition: transform 0.2s; }
.related-card:hover { transform: translateY(-3px); }
.related-thumb { position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: #f1f5f9; margin-bottom: 0.5rem; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-card h3 { font-size: 0.85rem; font-weight: 600; line-height: 1.35; margin: 0 0 0.25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-meta { font-size: 0.75rem; color: var(--text-secondary); }

/* CTA */
.video-cta { text-align: center; padding: 3rem 0 4rem; }
.video-cta h2 { font-size: 1.75rem; margin-bottom: 0.75rem; color: var(--text); }
.video-cta p { color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 500px; margin-left: auto; margin-right: auto; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .video-library-header { padding: 80px 0 24px; }
  .video-library-header h1 { font-size: 1.75rem; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
  .video-header h1 { font-size: 1.5rem; }
  .related-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
  .video-controls { flex-direction: column; }
  .video-search { width: 100%; }
}
@media (max-width: 480px) {
  .video-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}
