/* Gallery Container */
.video-gallery-collection {
  margin-bottom: 40px;
}

.video-collection-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #222;
}

.video-collection-description {
  font-size: 14px;
  color: #666;
  margin-bottom: 25px;
  line-height: 1.5;
}

.video-collection-name {
  display: block;
  font-size: 24px;
  font-weight: 600;
  color: #222;
  margin-bottom: 20px;
}

/* Search Container */
.video-search-container {
  position: relative;
  margin-bottom: 20px;
  max-width: 600px;
  display: flex;
}

.video-search-input {
  width: 100%;
  padding: 12px 15px 12px 15px;
  font-size: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.3s ease;
}

.video-search-input:focus {
  border-color: #666;
}

.video-search-clear {
  position: absolute;
  right: 0px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  transition: color 0.2s;
}

.video-search-clear:hover {
  color: #333;
}

.video-search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #ddd;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 250px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
}

.autocomplete-item {
  padding: 10px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background-color: #f5f5f5;
}

.autocomplete-item[data-type="tag"] {
  color: #555;
}

.autocomplete-item[data-type="category"] {
  color: #2962ff;
  font-weight: 500;
}

.autocomplete-item[data-type="video"] {
  color: #00796b;
  font-weight: 500;
}

.video-stars {
  color: #848383;
  font-size: 18px;
  margin-bottom: 4px;
}

.video-description {
  color: #666;
  font-size: 14px;
  line-height: 1.4;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

/* Filter Bar */
.video-filter-bar {
  display: flex;
  gap: 30px;
  margin-bottom: 25px;
  align-items: center;
  flex-wrap: wrap;
  padding-bottom: 15px;
  border-bottom: 1px solid #c5c5c5;
}

.video-filter-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 18px;
  user-select: none;
}

.video-filter-bar input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  align-items: start;
}

.video-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Landscape cards (16:9) - default wide format */
.video-card[data-video-type="landscape"] {
  grid-column: span 1;
  max-width: 100%;
}

/* Portrait cards (9:16) - tall format */
.video-card[data-video-type="portrait"] {
  grid-column: span 1;
  max-width: 320px;
  justify-self: center;
}

/* Square cards (1:1) */
.video-card[data-video-type="square"] {
  grid-column: span 1;
  max-width: 380px;
  justify-self: center;
}

.video-thumb {
  position: relative;
  cursor: pointer;
  width: 100%;
  overflow: hidden;
}

.video-thumb img {
  display: block;
}

.video-thumb-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Aspect ratio for different video types */
.video-card[data-video-type="landscape"] .video-thumb-img {
  aspect-ratio: 16/9;
  min-height: 200px;
}

.video-card[data-video-type="portrait"] .video-thumb-img {
  aspect-ratio: 9/16;
  min-height: 400px;
}

.video-card[data-video-type="square"] .video-thumb-img {
  aspect-ratio: 1/1;
  min-height: 280px;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.video-info {
  padding: 12px 15px 15px 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.video-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.video-title {
  font-size: 16px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  ;
}

.video-meta span {
  background: transparent;
  padding: 2px 10px;
  font-size: 13px;
  border: 1px solid #000;
  border-radius: 3px;
  display: inline-block;
}

.video-meta span.collection-badge {
  background: transparent;
  padding: 2px 10px;
  font-size: 13px;
  border: 1px solid #000;
  border-radius: 3px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.video-meta span.category-badge {
  background: transparent;
  padding: 2px 10px;
  font-size: 13px;
  border: 1px solid #000;
  border-radius: 3px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.video-meta span.tag-badge {
  padding: 2px 10px;
  font-size: 13px;
  border: 1px solid #000;
  border-radius: 3px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.video-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: start;
  margin-top: auto;
  gap: 10px;
  flex-wrap: wrap;
}

.view-btn {
  background: #fff;
  color: #1E1E1E;
  padding: 6px 20px;
  border-radius: 30px;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.3s ease;
  border: 2px solid #1E1E1E;
  white-space: nowrap;
  font-weight: 600;
  cursor: pointer;
}

.view-btn:hover {
  background: #1E1E1E;
  color: #fff;
}

/* Button icons */
.btn-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* Dropdown container */
.vgf-dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown arrow */
.dropdown-arrow {
  font-size: 10px;
  margin-left: 4px;
  transition: transform 0.2s;
}

.vgf-dropdown-toggle:hover .dropdown-arrow {
  transform: translateY(2px);
}

/* Dropdown menu */
.vgf-dropdown-menu {
  position: absolute;
  top: 90%;
  right: 0;
  min-width: 180px;
  background: white;
  border: 2px solid #1E1E1E;
  border-radius: 12px;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.vgf-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown items */
.vgf-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #1E1E1E;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.vgf-dropdown-item:first-child {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.vgf-dropdown-item:last-child {
  border-bottom: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.vgf-dropdown-item:hover {
  background-color: #f5f5f5;
}

/* Dropdown icons */
.dropdown-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Video Popup */
.video-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999999;
}

/* Landscape videos (16:9) - default */
.video-popup.popup-landscape iframe {
  width: 80%;
  height: 70%;
  max-width: 1200px;
  border-radius: 12px;
}

/* Portrait videos (9:16) */
.video-popup.popup-portrait iframe {
  width: 45%;
  height: 85%;
  max-width: 600px;
  border-radius: 12px;
}

/* Square videos (1:1) */
.video-popup.popup-square iframe {
  width: 60%;
  height: auto;
  aspect-ratio: 1/1;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 12px;
}

.video-popup-close {
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 28px;
  color: white;
  cursor: pointer;
  z-index: 10000000;
  transition: color 0.2s;
}

.video-popup-close:hover {
  color: #ccc;
}

body.vgf-popup-open {
  overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
  .video-search-container {
    max-width: 100%;
    margin-bottom: 15px;
  }

  .video-search-input {
    font-size: 16px;
    /* Prevents zoom on iOS */
    padding: 10px 40px 10px 12px;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }

  .video-card[data-video-type="landscape"] {
    grid-column: span 1;
  }

  .video-card[data-video-type="portrait"],
  .video-card[data-video-type="square"] {
    max-width: 100%;
  }

  .video-filter-bar {
    gap: 12px;
    margin-bottom: 20px;
  }

  .video-popup.popup-landscape iframe {
    width: 95%;
    height: 60%;
  }

  .video-popup.popup-portrait iframe {
    width: 85%;
    height: 75%;
  }

  .video-popup.popup-square iframe {
    width: 90%;
    height: auto;
    aspect-ratio: 1/1;
  }

  .video-collection-title {
    font-size: 22px;
  }
}