/* Screen Reader Only (Accessibility) */
.sr-only, .video-sr-status, .user-announcement.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Video Fallback Image Styles - NO ANIMATION/PULSING */
.video-fallback {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: none;
  opacity: 1; /* Changed from 0 to 1 - fallback should be solid when visible */
  transition: opacity 0.5s ease;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* IMPORTANT: No animation or pulsing effects */
  animation: none !important;
}

.video-fallback.visible {
  display: block;
  opacity: 1; /* Solid when visible - no semi-transparency */
  animation: none !important; /* Ensure no pulsing animation */
}

/* Ensure video element is above fallback when playing */
video.hero-video,
video.fullwidth-video {
  position: relative;
  z-index: 2;
  transition: opacity 0.5s ease;
}

/* Data Usage Warning Modal */
.data-usage-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

.data-usage-dialog {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideInUp 0.3s ease-out;
}

.data-warning-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.data-warning-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  flex-shrink: 0;
}

.data-warning-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.data-warning-content {
  margin-bottom: 1.5rem;
}

.data-warning-text {
  color: #475569;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.data-usage-stats {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.data-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.data-stat:last-child {
  border-bottom: none;
}

.data-stat-label {
  color: #64748b;
  font-size: 0.875rem;
}

.data-stat-value {
  color: #0f172a;
  font-weight: 600;
  font-size: 0.875rem;
}

.data-warning-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.data-warning-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.data-warning-btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.data-warning-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.data-warning-btn-secondary {
  background: #f1f5f9;
  color: #475569;
}

.data-warning-btn-secondary:hover {
  background: #e2e8f0;
}

/* Video Loading Overlay - Shown while video is loading */
.video-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-spinner-modern {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.loading-subtext {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Video Loading Trigger - Play button with data info */
.video-loading-trigger {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.video-loading-trigger:hover {
  background: rgba(0, 0, 0, 0.6);
}

.trigger-content {
  text-align: center;
  color: white;
}

.play-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Modern Play Button - NO PULSING ANIMATION ON FALLBACK */
.modern-play-button {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  color: #1e293b;
}

.modern-play-button:hover {
  transform: scale(1.1);
  background: white;
}

.modern-play-button .play-icon {
  width: 32px;
  height: 32px;
  margin-left: 4px;
}

.video-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
}

.video-size,
.connection-type {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Data Usage Indicator */
.data-usage-indicator {
  margin-top: 1.5rem;
}

.data-warning {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.data-warning svg {
  width: 16px;
  height: 16px;
}

.data-warning.large-file {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

/* Video Progress Indicator */
.video-progress {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  color: white;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

.progress-bar-container {
  width: 100%;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.loading-text {
  font-weight: 600;
  font-size: 0.875rem;
}

.progress-percentage {
  font-weight: 700;
  color: #3b82f6;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.loading-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.bytes-loaded {
  color: #06b6d4;
  font-weight: 600;
}

.connection-speed {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  text-transform: uppercase;
}

/* Manual Play Overlay (Professional) */
.manual-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  transition: all 0.3s ease;
}

.manual-play-overlay:hover {
  background: rgba(0, 0, 0, 0.6);
}

/* Professional Play Button - CAN have pulse animation for play button only */
.professional-play-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: white;
  transition: all 0.3s ease;
}

.professional-play-btn:hover {
  transform: scale(1.05);
}

.play-btn-circle {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.3);
  /* Animation only on play button circle, NOT on fallback images */
  animation: playPulse 3s ease-in-out infinite;
}

.professional-play-btn:hover .play-btn-circle {
  background: white;
  transform: scale(1.1);
}

.play-btn-circle .play-icon {
  width: 32px;
  height: 32px;
  color: #1e293b;
  margin-left: 4px;
}

.play-text {
  font-size: 1rem;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Pulse animation ONLY for play button - NOT for fallback images */
@keyframes playPulse {
  0%, 100% {
    box-shadow:
      0 10px 40px rgba(0, 0, 0, 0.3),
      0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  50% {
    box-shadow:
      0 10px 40px rgba(0, 0, 0, 0.3),
      0 0 0 15px rgba(255, 255, 255, 0.1),
      0 0 0 30px rgba(255, 255, 255, 0.05);
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Disable all pulsing animations for users who prefer reduced motion */
  .play-btn-circle {
    animation: none !important;
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .modern-play-button,
  .play-btn-circle {
    width: 64px;
    height: 64px;
  }

  .modern-play-button .play-icon,
  .play-btn-circle .play-icon {
    width: 24px;
    height: 24px;
  }

  .video-info h3 {
    font-size: 1rem;
  }

  .video-meta {
    font-size: 0.75rem;
  }

  .video-progress {
    width: 95%;
    padding: 0.75rem 1rem;
  }

  .data-usage-dialog {
    margin: 1rem;
    padding: 1.5rem;
  }

  .data-warning-title {
    font-size: 1.25rem;
  }

  .data-warning-actions {
    flex-direction: column;
  }

  .data-warning-btn {
    width: 100%;
  }
}

/* Streaming Indicator Styles */
.streaming-indicator {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.9);
  padding: 8px 16px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.streaming-dots {
  display: flex;
  gap: 4px;
}

.streaming-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  animation: streamingPulse 1.4s infinite ease-in-out;
}

.streaming-dots span:nth-child(1) { animation-delay: -0.32s; }
.streaming-dots span:nth-child(2) { animation-delay: -0.16s; }
.streaming-dots span:nth-child(3) { animation-delay: 0s; }

.streaming-text {
  font-weight: 500;
  color: #10b981;
}

/* Minimal Play Prompt */
.minimal-play-prompt {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 5;
}

.minimal-play-btn {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.minimal-play-btn:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.minimal-play-btn svg {
  width: 20px;
  height: 20px;
  color: #1e293b;
  margin-left: 2px;
}

/* Video Quality Selector */
.video-quality-selector {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 8px;
  padding: 0.5rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.quality-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.quality-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.quality-btn.active {
  background: white;
  color: #1e293b;
  border-color: white;
}

/* Video Preferences Panel */
.video-preferences-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: #1e293b;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  color: white;
  max-width: 400px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.preferences-content h3 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.preference-item {
  margin-bottom: 1rem;
}

.preference-item label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.preference-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.preference-item select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 4px;
  background: #374151;
  border: 1px solid #4b5563;
  color: white;
  margin-top: 0.5rem;
  cursor: pointer;
}

.preferences-info {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preferences-info small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
}

@media (max-width: 640px) {
  .video-preferences-panel {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .preference-item label {
    font-size: 0.875rem;
  }

  .preference-item select {
    background: #374151;
    color: white;
    border-color: #4b5563;
  }
}

/* Animation keyframes */
@keyframes streamingPulse {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
