/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require_tree .
 *= require_self
 */

/* Video Player Component Styles */
.video-modal {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.video-fullscreen-container {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.video-player-loading {
  position: relative;
}

.video-player-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  z-index: 10;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Play button hover effects */
.video-play-button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.video-play-button:hover {
  transform: scale(1.1);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.video-play-button:active {
  transform: scale(0.95);
}

/* Card hover effects */
.video-card:hover .video-play-button {
  transform: scale(1.05);
}

/* Modal animations */
.video-modal.show {
  opacity: 1;
  visibility: visible;
}

.video-modal.show .video-modal-content {
  transform: scale(1);
  opacity: 1;
}

.video-modal-content {
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  max-width: 90vw;
}

/* Responsive video containers */
@media (max-width: 768px) {
  .video-modal-content {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }
}

/* Touch gesture indicators */
.video-fullscreen-container::after {
  content: "Swipe down or right to close";
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 16px;
  border-radius: 20px;
  pointer-events: none;
  animation: fadeInOut 4s ease-in-out;
}

@keyframes fadeInOut {
  0%,
  100% {
    opacity: 0;
  }
  10%,
  90% {
    opacity: 1;
  }
}

/* Smooth aspect ratio transitions */
.aspect-video {
  transition: all 0.3s ease;
}

/* Error state styles */
.video-error {
  background: linear-gradient(45deg, #ef4444, #dc2626);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.video-error-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.8;
}

/* Focus styles for accessibility */
.video-play-button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.video-modal:focus-within {
  outline: none;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .video-play-button,
  .video-modal-content,
  .aspect-video {
    transition: none;
  }

  .video-play-button:hover {
    transform: none;
  }

  @keyframes spin {
    to {
      transform: none;
    }
  }

  @keyframes fadeInOut {
    0%,
    100% {
      opacity: 0;
    }
    50% {
      opacity: 1;
    }
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .video-play-button {
    border: 2px solid currentColor;
  }

  .video-modal {
    backdrop-filter: none;
    background: rgba(0, 0, 0, 0.9);
  }
}

/* Print styles - hide video players */
@media print {
  .video-modal,
  .video-fullscreen-container,
  .video-play-button {
    display: none !important;
  }
}
