/* Video Grid Widget Styles */
.video-grid-container {
  background-color: #000000;
  padding: 80px 20px;
  text-align: center;
  position: relative;
}

.vg-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* Typography */
.vg-title {
  font-size: 48px;
  font-weight: 400;
  color: #ffffff;
  margin: 0 0 20px 0;
  font-family: "Poiret One", Sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.vg-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: #ffffff;
  margin: 0 0 60px 0;
  font-family: "Poiret One", Sans-serif;
  text-transform: uppercase;
  letter-spacing: 3px;
  opacity: 0.9;
}

/* Video Grid */
.vg-videos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 0 auto 60px auto;
  max-width: 1000px;
  width: 100%;
  box-sizing: border-box;
  justify-items: center;
}

.vg-video-item {
  position: relative;
  aspect-ratio: 9/16;
  border-radius: 8px;
  overflow: hidden;
  background: #222;
  max-width: 100%;
  max-height: 100%;
}

.vg-video-player {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  outline: none;
  background: #000;
}

.vg-video-player::-webkit-media-controls {
  background-color: rgba(0, 0, 0, 0.8);
}

.vg-video-player::-webkit-media-controls-panel {
  background-color: rgba(0, 0, 0, 0.8);
}

/* MediaElement.js Poster Fix */
.vg-video-item .mejs-mediaelement {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

.vg-video-item .mejs-poster.mejs-layer {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.vg-video-item .mejs-poster img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

.vg-video-item .mejs-overlay-play {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 80px !important;
  height: 80px !important;
  z-index: 10 !important;
}

.vg-video-item .mejs-controls {
  display: none !important;
}

.vg-video-item .mejs-overlay-loading {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

/* Button */
.vg-button {
  display: inline-block;
  padding: 15px 40px;
  border: 2px solid #ffffff;
  color: #ffffff;
  text-decoration: none;
  font-family: "Poiret One", Sans-serif;
  font-size: 16px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  background: transparent;
}

.vg-button:hover {
  background-color: #ffffff;
  color: #000000;
  text-decoration: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .vg-videos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 600px;
  }

  .vg-video-item {
    max-width: 100%;
  }

  .vg-title {
    font-size: 40px;
  }

  .vg-subtitle {
    font-size: 14px;
    margin-bottom: 40px;
  }
}

@media (max-width: 768px) {
  .video-grid-container {
    padding: 60px 20px;
  }

  .vg-videos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 40px;
    max-width: 100%;
    width: 100%;
    padding: 0 10px;
  }

  .vg-video-item {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 9/16;
  }

  .vg-title {
    font-size: 32px;
    margin-bottom: 15px;
  }

  .vg-subtitle {
    font-size: 12px;
    margin-bottom: 30px;
    letter-spacing: 2px;
  }

  .vg-button {
    padding: 12px 30px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .video-grid-container {
    padding: 40px 15px;
  }

  .vg-videos-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 100%;
    width: 100%;
    padding: 0;
    margin-bottom: 30px;
  }

  .vg-video-item {
    max-width: 100%;
    width: 100%;
    min-height: 0;
    aspect-ratio: 9/16;
  }

  .vg-video-player {
    min-height: 0;
  }

  .vg-title {
    font-size: 24px;
  }

  .vg-subtitle {
    font-size: 11px;
    letter-spacing: 1px;
  }

  .vg-button {
    padding: 10px 25px;
    font-size: 12px;
    letter-spacing: 1px;
  }
}

@media (max-width: 360px) {
  .video-grid-container {
    padding: 30px 10px;
  }

  .vg-videos-grid {
    gap: 10px;
    justify-items: center;
  }

  .vg-title {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .vg-subtitle {
    font-size: 10px;
    margin-bottom: 20px;
  }
}

/* Elementor Editor Styles */
.elementor-editor-active .vg-video-player {
  pointer-events: none;
}

/* Video loading placeholder */
.vg-video-item:empty {
  background: linear-gradient(45deg, #333, #555);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vg-video-item:empty:before {
  content: "Upload Video";
  color: #ffffff;
  font-size: 14px;
  opacity: 0.7;
  font-family: "Poiret One", Sans-serif;
}
