/* Custom styles for Invidious */

/* Dark theme enhancements */
body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
}

/* Video grid animations */
.video-card {
  transition: all 0.3s ease;
  transform: translateY(0);
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.video-card img {
  transition: transform 0.3s ease;
}

.video-card:hover img {
  transform: scale(1.05);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Line clamp utility */
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Video player custom controls */
#controls-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
}

#progress-bar {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  outline: none;
}

#progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #ef4444;
  border-radius: 50%;
  cursor: pointer;
}

#progress-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #ef4444;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Theater mode */
.theater-mode {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  max-width: 100%;
  height: 80vh;
}

/* Loading spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* Notification animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification {
  animation: slideIn 0.3s ease;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  #search-form {
    margin: 0;
  }
  
  .video-card {
    margin-bottom: 1rem;
  }
}

/* Smooth transitions */
* {
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Button hover effects */
button {
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

button:hover::before {
  width: 100%;
  height: 100%;
}

/* Quality menu */
#quality-menu {
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
  max-height: 200px;
  overflow-y: auto;
}

/* Comments section */
#comments-container {
  max-height: 600px;
  overflow-y: auto;
}

/* Playlist modal */
.playlist-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1f2937;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  z-index: 1000;
  max-width: 500px;
  width: 90%;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
}

/* Shorts page */
.shorts-container {
  height: calc(100vh - 80px);
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}

.shorts-video {
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PWA install prompt */
.pwa-install-prompt {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: #ef4444;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  header, #player-controls, #related-videos, #comments-container {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
}