/**
 * Protected Video Player Styles
 *
 * @package WC_Pixel_Editor
 * @since 1.0.0
 */

/* Container */
.protected-video-container {
  position: relative;
  width: 100%;
  max-width: 800px; /* Largeur maximale par défaut */
  margin: 20px auto;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Player */
.protected-video-player {
  position: relative;
  width: 100%;
  min-height: 300px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Video Element */
.protected-video-element {
  width: 100%;
  height: auto;
  display: block;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Disable pointer events on video to prevent some download attempts */
.protected-video-element::cue {
  user-select: none;
}

/* Loading State */
.protected-video-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  padding: 40px;
}

.protected-video-loading .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.protected-video-loading .loading-text {
  font-size: 14px;
  font-weight: 500;
}

/* Error State */
.protected-video-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 40px;
  text-align: center;
  background: #1a1a1a;
  color: #fff;
  min-height: 300px;
}

.protected-video-error .error-icon {
  width: 48px;
  height: 48px;
  color: #ef4444;
}

.protected-video-error .error-icon svg {
  width: 100%;
  height: 100%;
}

.protected-video-error p {
  margin: 0;
  font-size: 16px;
  color: #d1d5db;
  max-width: 400px;
}

/* Password Prompt */
.protected-video-password-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 60px 40px;
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  min-height: 300px;
}

.protected-video-password-prompt .password-prompt-icon {
  width: 64px;
  height: 64px;
  opacity: 0.9;
}

.protected-video-password-prompt .password-prompt-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.protected-video-password-prompt h3 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.protected-video-password-prompt p {
  margin: 0;
  font-size: 16px;
  opacity: 0.95;
  max-width: 400px;
  line-height: 1.6;
}

/* Warning Message */
.protected-video-warning {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(245, 158, 11, 0.95);
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  max-width: 90%;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.protected-video-warning .warning-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.protected-video-warning p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

/* Watermark (optional) */
.protected-video-watermark {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-family: monospace;
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
  z-index: 100;
}

/* Responsive */
@media (max-width: 768px) {
  .protected-video-container {
    margin: 15px auto;
    border-radius: 4px;
  }

  .protected-video-player {
    min-height: 200px;
  }

  .protected-video-error,
  .protected-video-password-prompt {
    padding: 40px 20px;
    min-height: 250px;
  }

  .protected-video-error .error-icon,
  .protected-video-password-prompt .password-prompt-icon {
    width: 40px;
    height: 40px;
  }

  .protected-video-error p,
  .protected-video-password-prompt p {
    font-size: 14px;
  }

  .protected-video-password-prompt h3 {
    font-size: 20px;
  }

  .protected-video-warning {
    bottom: 10px;
    padding: 10px 16px;
    max-width: 95%;
  }

  .protected-video-warning p {
    font-size: 13px;
  }
}

/* Print - hide videos */
@media print {
  .protected-video-container {
    display: none;
  }
}

/* Accessibility - Focus states */
.protected-video-element:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .protected-video-error,
  .protected-video-password-prompt {
    border: 2px solid currentColor;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .protected-video-loading .spinner,
  .protected-video-warning {
    animation: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .protected-video-error {
    background: #0f0f0f;
  }

  .protected-video-error p {
    color: #e5e7eb;
  }
}
