/* --- OGÓLNY LAYOUT --- */
.rebrandy-short-cases {
  width: 100%;
  overflow-x: auto;
  padding: 10px;
}

/* --- FILTRY SORTOWANIA --- */
.sort-filters {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px 0;
  border-bottom: 1px solid #e9ecef;
}

.filter-label {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
}

.filter-btn {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 20px;
  padding: 8px 16px;
  color: #495057;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.filter-btn:hover {
  background: #e9ecef;
  border-color: #ced4da;
  color: #343a40;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
  background: #007cba;
  border-color: #007cba;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.filter-btn.active:hover {
  background: #005a85;
  border-color: #005a85;
}

/* Responsywność dla filtrów */
@media (max-width: 480px) {
  .sort-filters {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .filter-label {
    width: 100%;
    margin-bottom: 5px;
  }
  
  .filter-btn {
    flex: 1;
    text-align: center;
    min-width: 120px;
  }
}

/* Responsive padding */
@media (min-width: 768px) {
  .rebrandy-short-cases {
    padding: 20px;
  }
}

@media (min-width: 1200px) {
  .rebrandy-short-cases {
    padding: 20px 40px;
  }
}

.video-feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  max-width: 100%;
  align-items: stretch;
}

/* Desktop - maksymalnie 5 filmów w rzędzie */
@media (min-width: 1200px) {
  .video-feed {
    grid-template-columns: repeat(5, 1fr);
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* Large desktop - nadal 5 kolumn */
@media (min-width: 1400px) {
  .video-feed {
    grid-template-columns: repeat(5, 1fr);
    max-width: 1500px;
    margin: 0 auto;
    gap: 20px;
  }
}

/* Tablet - 3-4 filmy */
@media (min-width: 768px) and (max-width: 1199px) {
  .video-feed {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-width: 1000px;
    margin: 0 auto;
  }
}

/* Mobile - 1 film */
@media (max-width: 767px) {
  .video-feed {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .rebrandy-short-cases {
    padding: 10px 15px;
  }
  
  /* Mniejsze przyciski na mobilkach */
  .share-btn {
    width: 32px;
    height: 32px;
    padding: 6px;
  }
  
  .share-btn svg {
    width: 16px;
    height: 16px;
  }
  
  .like-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
  }
}

.video-item {
  display: grid;
  grid-template-rows: auto minmax(60px, auto) auto auto;
  align-items: stretch;
  background: #fff;
  border-radius: 20px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
  overflow: hidden;
  height: 100%;
}

.video-item:hover {
  transform: scale(1.02);
}

.video-item video {
  width: 100%;
  border-radius: 15px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  cursor: pointer;
}

/* YouTube Preview Style */
.video-item .youtube-preview {
  width: 100%;
  border-radius: 15px;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #000;
}

.video-item .youtube-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
  transition: transform 0.2s ease;
}

.video-item .youtube-preview:hover img {
  transform: scale(1.02);
}

.youtube-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff0000;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.youtube-play-overlay:hover {
  background: rgba(255, 255, 255, 1);
  transform: translate(-50%, -50%) scale(1.1);
}

.youtube-play-overlay svg {
  width: 24px;
  height: 24px;
  margin-left: 3px; /* Przesunięcie dla wizualnego wycentrowania */
}

.youtube-shorts-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ff0000;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Fallback gdy miniaturka się nie załaduje */
.youtube-preview img[src*="mqdefault"] {
  object-position: center top;
}

.video-item .youtube-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #ff0000, #cc0000);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 15px;
}

.video-item .youtube-preview:hover::before {
  opacity: 0.1;
}

/* --- OPIS I META --- */
.video-info {
  display: flex;
  align-items: start;
  min-height: 60px;
}

.video-info h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111;
  margin: 12px 0 8px 0;
  text-align: left;
  padding: 0 10px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-description {
  font-size: 0.85rem;
  color: #444;
  margin: 0;
  padding: 0 10px;
  text-align: left;
  overflow: hidden;
  max-height: 40px;
  transition: max-height 0.3s ease;
  line-height: 1.4;
}

.video-description.expanded {
  max-height: 200px;
}

.toggle-desc {
  display: block;
  text-align: left;
  color: #007cba;
  font-size: 0.8rem;
  margin: 4px 0 0 10px;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 500;
}

.video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 10px 12px;
  font-size: 0.85rem;
  color: #555;
  margin-top: auto;
  align-self: end;
}

/* --- PRZYCISKI AKCJI --- */
.like-btn, .share-btn {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 20px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}

.like-btn {
  gap: 6px;
  color: #555;
  min-width: 70px;
}

.like-btn:hover {
  background: #ffe6f0;
  border-color: #ff99cc;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 0, 102, 0.2);
}

.like-btn .heart-icon {
  font-size: 1.2rem;
  transition: all 0.2s ease;
  color: #888;
}

.like-btn[data-liked="true"] .heart-icon::before {
  content: '♥';
  color: #ff0066;
}

.like-btn[data-liked="false"] .heart-icon::before {
  content: '♡';
  color: #888;
}

.likes-count {
  font-weight: 500;
  min-width: 20px;
}

.like-btn[data-liked="true"] {
  color: #ff0066;
}

.like-btn.animate {
  animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1.05); }
}

/* Specyficzne style dla share */
.share-btn {
  color: #1DA1F2;
  min-width: 36px;
  gap: 0;
}

.share-btn svg {
  width: 18px;
  height: 18px;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: #e3f2fd;
  border-color: #90caf9;
  color: #0d8bd9;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(29, 161, 242, 0.2);
}

.share-btn:active, .like-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* --- POPUP (pełnoekranowy, z pionowym filmem) --- */
.video-popup {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.96);
  z-index: 2147483647 !important; /* Maksymalny możliwy z-index */
  justify-content: center;
  align-items: center;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.video-popup.active {
  display: flex;
  opacity: 1;
}

/* blokowanie scrolla strony */
body.popup-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

/* Ukryj tylko cookie overlay gdy popup jest otwarty - NIE ukrywaj header/nav/footer */
body.popup-open .cky-overlay,
body.popup-open .cky-btn-revisit-wrapper,
body.popup-open [id*="cookie"],
body.popup-open [class*="cookie"],
body.popup-open [class*="gdpr"] {
  display: none !important;
  z-index: -1 !important;
}

/* USUŃ PROBLEMATYCZNE REGUŁY - powodują konflikty z event'ami */
/* Te reguły są zbyt agresywne i blokują interaction */

.video-popup-content {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: default; /* Resetuj cursor dla zawartości */
}

.video-popup-item {
  width: 100%;
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 100vh;
}

/* 🔹 pionowy format video (max 450px szerokości) */
.video-popup-item video {
  width: auto;
  height: 90vh;
  aspect-ratio: 9 / 16;
  max-width: 450px;
  border-radius: 12px;
  object-fit: cover;
  background: #000;
}

/* YouTube Embed w popupie */
.video-popup-item .youtube-embed {
  width: auto;
  height: 90vh;
  aspect-ratio: 9 / 16;
  max-width: 450px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.video-popup-item .youtube-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

/* Ukryj kontrolki YouTube - czysty wygląd */
.video-popup-item .youtube-embed iframe {
  pointer-events: none; /* Wyłącz kliknięcia na iframe */
}

/* Opcjonalnie - overlay który blokuje interakcję z YouTube */
.video-popup-item .youtube-embed::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 1;
  pointer-events: none;
}

/* NAPRAW pointer events - upewnij się że popup jest interaktywny */
.video-popup {
  pointer-events: auto !important;
}

.video-popup-content {
  pointer-events: auto !important;
}

.video-popup-item {
  pointer-events: auto !important;
}

.close-popup {
  pointer-events: auto !important;
}

.scroll-indicator {
  pointer-events: auto !important;
}

/* Dół z opisem i tytułem */
.video-popup-info {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 420px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  padding: 15px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.video-popup-info h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.video-popup-info p {
  font-size: 0.85rem;
  opacity: 0.95;
  color: #f0f0f0;
  line-height: 1.4;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

/* Zamknięcie */
.close-popup {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  background: rgba(0, 0, 0, 0.7) !important;
  color: #fff !important;
  border: 2px solid rgba(255,255,255,0.4) !important;
  font-size: 24px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  border-radius: 50% !important;
  width: 50px !important;
  height: 50px !important;
  z-index: 2147483647 !important;
  backdrop-filter: blur(10px);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  font-family: Arial, sans-serif !important;
}

.close-popup:hover {
  background: rgba(255, 0, 0, 0.8) !important;
  transform: scale(1.1) !important;
  border-color: rgba(255,255,255,0.8) !important;
}

.close-popup:active {
  transform: scale(0.95) !important;
  background: rgba(200, 0, 0, 0.9) !important;
}

/* Mobile-friendly zamknięcie */
@media (max-width: 768px) {
  .close-popup {
    top: 15px !important;
    right: 15px !important;
    width: 55px !important;
    height: 55px !important;
    font-size: 28px !important;
    background: rgba(0,0,0,0.8) !important;
    border: 3px solid rgba(255,255,255,0.6) !important;
  }
}

/* Wskaźniki przewijania */
.scroll-indicators {
  position: fixed !important;
  right: 30px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 2147483646 !important;
  opacity: 0.8;
}

.scroll-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  animation: bounce 2s infinite;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.scroll-indicator:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
  animation: none;
}

.scroll-indicator:active {
  transform: scale(0.95);
}

.scroll-indicator.up {
  animation-delay: 0s;
}

.scroll-indicator.down {
  animation-delay: 1s;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .scroll-indicators {
    display: none !important; /* Ukryj na mobilkach */
  }
  
  .scroll-indicator {
    display: none !important; /* Ukryj na mobilkach */
  }
  
  .video-popup-info {
    bottom: 15px;
    width: 95%;
    padding: 12px 16px;
    max-width: 350px;
  }
  
  .video-popup-info h3 {
    font-size: 1rem;
    margin: 0 0 6px;
  }
  
  .video-popup-info p {
    font-size: 0.8rem;
  }
}

/* Wskaźnik swipe dla mobile - WYŁĄCZONY */
.swipe-hint {
  display: none !important; /* Ukryj kompletnie */
}

/* Swipe animations usunięte - nie potrzebujemy */