/* ========================================
   Video Floating Widget
   ======================================== */

.video-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 400px;
  height: 225px; /* 16:9 aspect ratio */
  background-color: #000;
  color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 1050;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 300ms ease-in-out, opacity 300ms ease;
}

/* Responsive adjustments for video widget */
@media (max-width: 1009px) {
  .video-widget {
    bottom: 5.5rem; /* Move higher to avoid overlapping with mobile navigation */
  }
}

@media (max-width: 768px) {
  .video-widget {
    width: 300px;
    height: 169px; /* Maintain 16:9 aspect ratio */
  }
}

@media (max-width: 480px) {
  .video-widget {
    width: 240px;
    height: 135px; /* Maintain 16:9 aspect ratio */
    bottom: 6rem;
    right: 1rem;
  }
}

.video-widget.is-hidden {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
}

.video-widget__header {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem;
  position: relative;
  z-index: 2;
}

.video-widget__close {
  background: none;
  border: none;
  color: #e2e8f0;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 200ms;
}



.video-widget__content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  z-index: 1;
  background: rgba(0, 0, 0, 0.5); /* Dark overlay for text readability */
  text-align: center;
}

.video-widget__title {
  font-size: 1.5rem;
  font-weight: 700;
}

.video-widget__text {
  font-size: 0.875rem;
  color: #e2e8f0;
  margin-bottom: 1rem;
}

.video-widget__play-btn {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #f43f5e;
  color: #ffffff;
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
}

.video-widget__play-btn:hover {
  background-color: #e11d48;
}

@media (max-width: 480px) {
    .video-widget__title {
        font-size: 1.1rem;
    }

    .video-widget__play-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

.video-widget__preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.7;
}

.video-widget__video-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floating-action-buttons {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1049;
  display: flex;
  gap: 0.5rem;
}

/* Responsive adjustments for floating action buttons */
@media (max-width: 1009px) {
  .floating-action-buttons {
    bottom: 5.5rem; /* Move higher to avoid overlapping with mobile navigation */
  }
}

@media (max-width: 768px) {
  .floating-action-buttons {
    right: 1rem;
  }
}

@media (max-width: 480px) {
  .floating-action-buttons {
    bottom: 6rem;
    right: 1rem;
    flex-direction: column; /* Stack buttons vertically on very small screens */
  }
}

.fab-btn {
  background-color: #f43f5e;
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  transition: all 300ms ease;
  padding: 0.75rem 1.25rem;
}

/* Responsive adjustments for fab buttons */
@media (max-width: 768px) {
  .fab-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  #video-open-btn span {
    display: none; /* Hide text on mobile, show only icon */
  }
}

.fab-btn:hover {
  background-color: #e11d48;
  transform: scale(1.05);
}

#video-open-btn {
  gap: 0.5rem;
}

.move-to-top {
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border-radius: 50%;
  background-color: #1e293b;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 300ms ease;
  /* display: none; is now handled by opacity/visibility */
}

.move-to-top.is-visible {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.move-to-top:hover {
  background-color: #334155;
}

/* ========================================
   Video Modal
   ======================================== */

.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.video-modal.is-visible {
  display: flex;
}

.video-modal__content {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.video-modal__video {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ensure the whole video is visible */
  display: block;
}

.video-modal__close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: gray;
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  z-index: 2001;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease;
  opacity: 0; /* Hidden by default */
}

.video-modal__close-btn.is-visible {
  opacity: 1;
}

.video-modal__controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 2.5rem; /* Match right padding to close button */
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Align buttons to the right */
  gap: 1rem;
  opacity: 0;
  transition: opacity 300ms ease;
}

.video-modal__controls.is-visible {
  opacity: 1;
}

.control-btn {
  background: none;
  border: none;
  color: gray;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 200ms ease;
}

.control-btn:hover {
  transform: scale(1.1);
}

