:root {
  --primary: #0066cc;
  --accent: #e63946;
  --bg: #ffffff;
  --surface: #f8f9fa;
  --text: #1a202c;
  --text-light: #4a5568;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --radius: 16px;
}
h2 {
    text-align: center;
    font-size: 3.5em;
    margin-bottom: 20px;
    position: relative;
}
h2::after {
    content: '';
    display: block;
    width: 120px;
    height: 5px;
    background: linear-gradient(to right, #fbd118, #097b3e);
    margin: 10px auto 30px auto;
    border-radius: 3px;
}
.title {
  text-align: center;
  padding: 2.5rem 5% 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.title p {
  font-size: 1.25rem;
  color: var(--text-light);
  max-width: 680px;
  margin: 0 auto;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2rem auto 3rem;
  max-width: 1100px;
  padding: 0 5%;
}
.filter-btn {
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.28s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,102,204,0.2);
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.8rem;
  padding: 0 5% 5% 5%;
  max-width: 1400px;
  margin: 0 auto;
}
.video-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  transform: translateY(50px);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}
.video-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.video-card:hover {
  transform: translateY(-14px);
  box-shadow: 0 25px 60px rgba(0,0,0,0.12);
}
.thumbnail-wrapper {
  position: relative;
  height: 100%;
  background: #000;
}
.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.video-card:hover .poster-img {
  transform: scale(1.06);
}
.youtube-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.video-card:hover .youtube-thumbnail {
  transform: scale(1.06);
}
.play-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 80px;
  height: 80px;
  background: rgba(0, 102, 204, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  animation: pulse 2.4s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.07); }
}
.video-card:hover .play-icon {
  background: var(--accent);
  animation: none;
  transform: scale(1.16);
}
.play-icon::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 24px solid white;
  margin-left: 6px;
}
.video-info {
  padding: 1.4rem 1.3rem 1.2rem;
  background: var(--surface);
}
.video-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  line-height: 1.4;
}
.video-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-light);
}
.duration {
  background: rgba(0,0,0,0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  color: var(--text);
}
.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.video-modal.active {
  opacity: 1;
  display: flex;
}
.modal-content {
  position: relative;
  width: 100%;
  max-width: 980px;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,0.25);
  transform: scale(0.94);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.video-modal.active .modal-content {
  transform: scale(1);
  opacity: 1;
}
.modal-header {
  padding: 1.2rem 1.8rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}
.close-btn {
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.1);
  border-radius: 50%;
  color: var(--text);
  font-size: 1.7rem;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}
.close-btn:hover {
  background: var(--accent);
  color: white;
  transform: rotate(90deg) scale(1.1);
}
.video-player-wrapper {
  position: relative;
  background: #000;
}
.video-player {
  width: 100%;
  height: auto;
  display: block;
}
.youtube-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.loading-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 60px;
  height: 60px;
  border: 5px solid rgba(255,255,255,0.2);
  border-top: 5px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 5;
}
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@media (max-width: 768px) {
  .video-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero h1 { font-size: 3.2rem; }
}