/* Custom animations and effects */
@keyframes fade-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out;
}

/* TV-style scanlines effect */
.tv-scanlines::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    rgba(0, 255, 0, 0.03) 50%, 
    transparent 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 1;
}

/* Enhanced TV bezel styling */
.tv-bezel {
  background: linear-gradient(145deg, #2c2c2c, #1a1a1a);
  border-radius: 20px;
  box-shadow: 
    inset 0 0 0 3px #333,
    inset 0 0 0 6px #222,
    0 20px 40px rgba(0,0,0,0.4),
    0 40px 80px rgba(0,0,0,0.2);
}

/* Enhanced glow effects for focused items */
.focus-glow {
  box-shadow: 
    0 0 20px rgba(59, 130, 246, 0.5),
    0 0 40px rgba(59, 130, 246, 0.3),
    0 0 60px rgba(59, 130, 246, 0.1),
    0 0 100px rgba(59, 130, 246, 0.05);
}

/* AI-powered gradient text effects */
.gradient-text {
  background: linear-gradient(45deg, #3b82f6, #8b5cf6, #ec4899, #10b981);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 100% 50%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
}

/* Smooth transitions for all interactive elements */
* {
  transition-property: transform, box-shadow, opacity, background-color, border-color;
  transition-duration: 0.2s;
  transition-timing-function: ease-out;
}

/* Hide scrollbars while keeping functionality */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Enhanced button hover states */
button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Starfield background animation */
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.star {
  animation: twinkle 3s infinite;
}

/* AI generation loading animations */
@keyframes ai-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.ai-loading {
  background: linear-gradient(90deg, 
    rgba(59, 130, 246, 0.1) 25%, 
    rgba(59, 130, 246, 0.3) 50%, 
    rgba(59, 130, 246, 0.1) 75%);
  background-size: 200px 100%;
  animation: shimmer 2s infinite;
}

/* Loading spinner customization */
@keyframes spin-smooth {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-spinner {
  animation: spin-smooth 1s linear infinite;
}

/* Enhanced movie poster effects */
.movie-poster {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.movie-poster:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(59, 130, 246, 0.2);
}

/* AI-generated content indicators */
.ai-badge {
  background: linear-gradient(45deg, #8b5cf6, #3b82f6);
  animation: gradient-shift 3s ease infinite;
}

/* Enhanced app icon animations */
@keyframes app-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.app-focused {
  animation: app-pulse 2s infinite;
}

/* Volume bar animation */
.volume-bar {
  transition: width 0.3s ease-out;
}

/* Enhanced backdrop blur for modals */
.modal-backdrop {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Screen reflection effect */
.tv-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.02) 50%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 10;
}

/* Streaming service specific styling */
.netflix-theme { background: linear-gradient(135deg, #e50914, #221f1f); }
.prime-theme { background: linear-gradient(135deg, #00a8e1, #232f3e); }
.hulu-theme { background: linear-gradient(135deg, #1ce783, #066b0f); }
.youtube-theme { background: linear-gradient(135deg, #ff0000, #cc0000); }
.disney-theme { background: linear-gradient(135deg, #113ccf, #040d3c); }
.appletv-theme { background: linear-gradient(135deg, #000000, #1d1d1f); }

/* Custom scrollbar for modal content */
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(75, 85, 99, 0.2);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.5);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.8);
}

/* Enhanced focus states for accessibility */
button:focus,
select:focus,
input:focus {
  outline: none;
  ring: 2px;
  ring-color: rgb(59, 130, 246);
  ring-opacity: 0.5;
}

/* AI generation queue indicator */
.generation-queue {
  background: linear-gradient(90deg, 
    rgba(139, 92, 246, 0.2),
    rgba(59, 130, 246, 0.3),
    rgba(139, 92, 246, 0.2)
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Success animation for completed generation */
@keyframes success-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.ai-success {
  animation: success-pulse 1s ease-out;
}

/* Responsive design for smaller screens */
@media (max-width: 1024px) {
  .tv-bezel {
    margin: 1rem;
    padding: 1rem;
  }
  
  .movie-carousel {
    padding: 0 1rem;
  }
  
  .remote-control {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    transform: scale(0.9);
  }
}

@media (max-width: 768px) {
  .tv-bezel {
    margin: 0.5rem;
    padding: 0.5rem;
  }
  
  .instructions {
    font-size: 0.75rem;
    padding: 0.5rem;
  }
  
  .modal-content {
    margin: 1rem;
    padding: 1rem;
  }
}

/* Dark theme enhancements */
.dark-theme {
  --bg-primary: rgb(17, 24, 39);
  --bg-secondary: rgb(31, 41, 55);
  --text-primary: rgb(243, 244, 246);
  --text-secondary: rgb(156, 163, 175);
  --accent: rgb(59, 130, 246);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .focus-glow {
    box-shadow: 0 0 0 4px rgb(59, 130, 246);
  }
  
  .gradient-text {
    background: rgb(59, 130, 246);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .star {
    animation: none;
  }
  
  .gradient-text {
    animation: none;
    background: rgb(59, 130, 246);
  }
}