/**
 * Content Portfolio Error Handling Styles
 * Styles for media error states, placeholders, and fallback content
 */

/* Media Error States */
.media-error {
  opacity: 0.6;
  filter: grayscale(100%);
}

.media-error-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(220, 53, 69, 0.9);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.media-error-indicator i {
  font-size: 0.9rem;
}

/* Video Error Container */
.video-error-container {
  width: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(44, 44, 44, 0.3), rgba(26, 26, 26, 0.5));
  border: 2px dashed rgba(220, 53, 69, 0.5);
  border-radius: 10px;
  padding: 40px 20px;
}

.video-error-message {
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
}

.video-error-message i {
  font-size: 3rem;
  color: #FF8C42;
  margin-bottom: 15px;
  display: block;
}

.video-error-message p {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 10px 0;
  color: #ffffff;
}

.video-error-message small {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
}

.btn-retry-video {
  margin-top: 15px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-retry-video:hover {
  background: linear-gradient(135deg, #c82333, #bd2130);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.btn-retry-video i {
  font-size: 0.85rem;
}

/* External Resource Error */
.external-resource-error {
  width: 100%;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(44, 44, 44, 0.2), rgba(26, 26, 26, 0.4));
  border: 2px dashed rgba(255, 193, 7, 0.5);
  border-radius: 15px;
  padding: 60px 40px;
}

.external-resource-error .error-content {
  text-align: center;
  max-width: 400px;
}

.external-resource-error i {
  font-size: 4rem;
  color: #D4AF37;
  margin-bottom: 20px;
  display: block;
}

.external-resource-error h4 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: #ffffff;
}

.external-resource-error p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 25px 0;
  line-height: 1.6;
}

.btn-view-external {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #D4AF37, #FF8C42);
  color: #1a1a1a;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-view-external:hover {
  background: linear-gradient(135deg, #ffb300, #ffa000);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

/* Fallback Content Styles */
.fallback-content {
  width: 100%;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(128, 128, 128, 0.1), rgba(64, 64, 64, 0.2));
  border: 2px dashed rgba(128, 128, 128, 0.4);
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

.fallback-content i {
  font-size: 3.5rem;
  color: rgba(128, 128, 128, 0.6);
  margin-bottom: 20px;
}

.fallback-content h4 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: rgba(255, 255, 255, 0.9);
}

.fallback-content p {
  font-size: 1rem;
  margin: 0 0 10px 0;
  color: rgba(255, 255, 255, 0.7);
}

.fallback-content small {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Specific Fallback Types */
.video-fallback {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
  border-color: rgba(220, 53, 69, 0.3);
}

.video-fallback i {
  color: rgba(220, 53, 69, 0.6);
}

.image-fallback {
  min-height: 200px;
  background: linear-gradient(135deg, rgba(128, 128, 128, 0.15), rgba(64, 64, 64, 0.1));
}

.carousel-fallback {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
  border-color: rgba(212, 175, 55, 0.3);
}

.carousel-fallback i {
  color: rgba(212, 175, 55, 0.6);
}

.gallery-fallback {
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.1), rgba(255, 140, 66, 0.05));
  border-color: rgba(255, 140, 66, 0.3);
}

.gallery-fallback i {
  color: rgba(255, 140, 66, 0.6);
}

/* Loading States */
.media-loading {
  position: relative;
  overflow: hidden;
}

.media-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Error Badge */
.error-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(220, 53, 69, 0.2);
  border: 1px solid rgba(220, 53, 69, 0.4);
  border-radius: 12px;
  font-size: 0.75rem;
  color: #dc3545;
  font-weight: 600;
}

.error-badge i {
  font-size: 0.7rem;
}

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

.btn-retry-video.retrying i,
.btn-retry-image.retrying i {
  animation: spin 1s linear infinite;
}

/* Responsive Error Styles */
@media (max-width: 768px) {
  .video-error-container {
    min-height: 250px;
    padding: 30px 15px;
  }

  .video-error-message i {
    font-size: 2.5rem;
  }

  .video-error-message p {
    font-size: 1.1rem;
  }

  .external-resource-error {
    min-height: 300px;
    padding: 40px 20px;
  }

  .external-resource-error i {
    font-size: 3rem;
  }

  .external-resource-error h4 {
    font-size: 1.3rem;
  }

  .fallback-content {
    min-height: 200px;
    padding: 30px 15px;
  }

  .fallback-content i {
    font-size: 2.5rem;
  }

  .fallback-content h4 {
    font-size: 1.1rem;
  }

  .media-error-indicator {
    font-size: 0.75rem;
    padding: 4px 8px;
  }
}

/* Accessibility */
.media-error-indicator,
.video-error-message,
.external-resource-error,
.fallback-content {
  outline: none;
}

.media-error-indicator:focus-visible,
.btn-retry-video:focus-visible,
.btn-view-external:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .media-error-indicator,
  .video-error-container,
  .external-resource-error,
  .fallback-content {
    display: none;
  }
}
