/* NeonStream Custom Styles */
:root {
  --bg-dark: #000000;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --accent-pink: #ff1493;
  --accent-pink-bright: #ff69b4;
  --accent-purple: #c41e3a;
  --border-gray: #333333;
  --glass-bg: rgba(0, 0, 0, 0.8);
  --neon-glow: 0 0 25px rgba(255, 20, 147, 0.7);
  --neon-glow-strong: 0 0 35px rgba(255, 20, 147, 0.9);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #000000 0%, #111111 50%, #000000 100%);
  color: var(--text-primary);
}

/* Glass morphism effect */
.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Neon glow effects */
.neon-glow-text {
  text-shadow: var(--neon-glow-strong);
  color: var(--accent-pink-bright);
}

.neon-glow-subtle {
  box-shadow: 0 0 20px rgba(255, 20, 147, 0.5);
}

.neon-glow-border {
  border: 1px solid var(--accent-pink);
  box-shadow: var(--neon-glow-strong);
}

/* Navigation styles */
.nav-link.active {
  background: rgba(255, 20, 147, 0.3);
  color: var(--accent-pink-bright);
  border-left: 3px solid var(--accent-pink);
  box-shadow: inset 0 0 10px rgba(255, 20, 147, 0.3);
}

/* Video card styles */
.video-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), var(--neon-glow-strong);
}

.video-thumbnail {
  aspect-ratio: 16/9;
  background: linear-gradient(45deg, #374151, #4b5563);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumbnail .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card:hover .play-overlay {
  opacity: 1;
}

.play-button {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-pink-bright));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: var(--neon-glow-strong);
}

/* Video metadata */
.video-info {
  padding: 12px 16px;
}

.video-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-duration {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  position: absolute;
  bottom: 8px;
  right: 8px;
}

/* Tags */
.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.tag {
  background: rgba(255, 20, 147, 0.3);
  color: var(--accent-pink-bright);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 20, 147, 0.5);
  box-shadow: 0 0 8px rgba(255, 20, 147, 0.3);
}

/* Video player styles */
.video-player-container {
  background: black;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.video-player {
  width: 100%;
  height: auto;
  min-height: 400px;
}

/* Form styles */
input, textarea, select {
  transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.5);
  border-color: var(--accent-pink);
}

/* Button styles */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-pink-bright));
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  box-shadow: 0 0 15px rgba(255, 20, 147, 0.4);
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: var(--neon-glow-strong);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-gray);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--bg-secondary);
}

/* Modal styles */
.modal-backdrop {
  backdrop-filter: blur(5px);
}

/* Loading spinner */
.spinner {
  border: 3px solid rgba(255, 20, 147, 0.3);
  border-top: 3px solid var(--accent-pink-bright);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  box-shadow: var(--neon-glow);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  
  .sidebar {
    width: 200px;
  }
}

@media (max-width: 640px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: fixed;
    left: -200px;
    transition: left 0.3s ease;
    z-index: 40;
    height: 100vh;
  }
  
  .sidebar.open {
    left: 0;
  }
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-pink);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* Utility classes */
.text-gradient {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.border-gradient {
  border: 1px solid;
  border-image: linear-gradient(135deg, var(--accent-pink), var(--accent-purple)) 1;
}

.hover-glow:hover {
  box-shadow: var(--neon-glow);
  transition: box-shadow 0.3s ease;
}

/* Animation classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

.slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Error and success states */
.error-message {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
}

.success-message {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
}

/* Video tags styling */
.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.video-tags .tag {
  background: rgba(255, 20, 147, 0.15);
  color: var(--accent-pink-bright);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 20, 147, 0.4);
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(255, 20, 147, 0.2);
}

.video-tags .tag:hover {
  border-color: var(--accent-pink);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 20, 147, 0.6);
  transform: translateY(-1px);
}

/* Library tag bubbles styling */
#tagBubbles button {
  transition: all 0.2s ease-in-out;
  background: #374151;
  border: 1px solid #4b5563;
  color: #9ca3af;
  padding: 3px 16px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

#tagBubbles button:hover {
  background: #4b5563;
  border-color: #6b7280;
  color: #ffffff;
}

#tagBubbles button.selected {
  background: rgba(255, 20, 147, 0.2);
  border-color: var(--accent-pink);
  color: var(--accent-pink-bright);
  box-shadow: 0 0 8px rgba(255, 20, 147, 0.4);
}

/* Mobile Sidebar Styles */
#sidebar {
  transition: transform 0.3s ease-in-out;
}

#sidebar.open {
  transform: translateX(0);
}

/* Ensure sidebar is visible on desktop */
@media (min-width: 768px) {
  #sidebar {
    transform: translateX(0) !important;
  }
}

/* Video Card Edit Menu */
.video-card {
  position: relative;
}



/* Edit tag bubbles styling */
#editVideoTagBubbles button {
  transition: all 0.2s ease-in-out;
  background: #374151;
  border: 1px solid #4b5563;
  color: #9ca3af;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  cursor: pointer;
}

#editVideoTagBubbles button:hover {
  background: #4b5563;
  border-color: #6b7280;
  color: #ffffff;
}

#editVideoTagBubbles button.selected {
  background: rgba(255, 20, 147, 0.2);
  border-color: var(--accent-pink);
  color: var(--accent-pink-bright);
  box-shadow: 0 0 8px rgba(255, 20, 147, 0.4);
}

/* Custom Video Player Styles */
.custom-video-player {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.video-element {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
}

.custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 20px 16px 16px;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.progress-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  margin-bottom: 12px;
  cursor: pointer;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-pink-bright));
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s ease;
  box-shadow: var(--neon-glow-subtle);
}

.progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 16px;
  height: 16px;
  background: var(--accent-pink-bright);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.2s ease;
  box-shadow: var(--neon-glow-strong);
  z-index: 2;
}

.controls-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-btn {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: rgba(255, 20, 147, 0.3);
  color: var(--accent-pink-bright);
  box-shadow: 0 0 8px rgba(255, 20, 147, 0.4);
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.volume-slider {
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  opacity: 0;
  transition: all 0.3s ease;
  transform: translateX(-10px);
}

.volume-container:hover .volume-slider {
  opacity: 1;
  transform: translateX(0);
}

.volume-container.volume-expanded .volume-slider {
  opacity: 1;
  transform: translateX(0);
}

.volume-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-pink-bright));
  border-radius: 2px;
  width: 100%;
  box-shadow: var(--neon-glow-subtle);
}

.volume-handle {
  position: absolute;
  top: 50%;
  left: 100%;
  width: 12px;
  height: 12px;
  background: var(--accent-pink-bright);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  box-shadow: var(--neon-glow-strong);
}

.time-display {
  color: white;
  font-size: 14px;
  font-weight: 500;
  min-width: 90px;
  text-align: center;
  transition: transform 0.3s ease;
}

.volume-container:hover + .time-display,
.volume-container.volume-expanded + .time-display {
  transform: translateX(15px);
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.play-button-overlay {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-pink-bright));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--neon-glow-strong);
}

.play-button-overlay:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 20, 147, 0.6);
}

.play-button-overlay i {
  margin-left: 4px; /* Adjust play icon position */
}

/* Fullscreen styles */
.custom-video-player:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.custom-video-player:fullscreen .video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Mobile responsiveness */
@media (max-width: 767px) {
  .controls-bottom {
    gap: 8px;
  }
  
  .controls-left {
    gap: 8px;
  }
  
  .control-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .time-display {
    font-size: 12px;
    min-width: 80px;
  }
  
  .volume-slider {
    width: 60px;
  }
  
  .play-button-overlay {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
}

/* Mobile Content Adjustments */
@media (max-width: 767px) {
  main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw;
  }
  
  /* Ensure main content container takes full width on mobile */
  body > div.flex {
    flex-direction: column;
  }
  
  body > div.flex > main {
    width: 100%;
    margin-left: 0;
  }
  
  #sidebar {
    position: fixed;
    left: 0;
    top: 72px; /* Account for header height */
    height: calc(100vh - 72px);
    z-index: 50;
  }
  
  .video-card .edit-menu {
    opacity: 1;
    visibility: visible;
  }
  
  /* Ensure video grids take full width */
  #videoGrid,
  #libraryGrid,
  #historyGrid,
  #searchGrid {
    width: 100%;
    margin: 0;
    padding: 0;
  }
}

/* Drag and Drop Upload Zone */
#dropZone {
  position: relative;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
  border: 2px dashed rgba(255, 20, 147, 0.3);
}

#dropZone:hover {
  border-color: var(--accent-pink);
  background: rgba(255, 20, 147, 0.05);
  box-shadow: 0 0 20px rgba(255, 20, 147, 0.2);
}

#dropZone.dragover {
  border-color: var(--accent-pink-bright);
  background: rgba(255, 20, 147, 0.1);
  box-shadow: var(--neon-glow);
  transform: scale(1.02);
}

#dropZone .fas.fa-cloud-upload-alt {
  color: rgba(255, 20, 147, 0.6);
  transition: all 0.3s ease;
}

#dropZone:hover .fas.fa-cloud-upload-alt {
  color: var(--accent-pink-bright);
  transform: scale(1.1);
}

#dropZone.dragover .fas.fa-cloud-upload-alt {
  color: var(--accent-pink-bright);
  animation: bounce 0.6s ease-in-out infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0) scale(1.1); }
  to { transform: translateY(-5px) scale(1.2); }
}

/* File selected state */
#fileSelected .fas.fa-video {
  color: var(--accent-pink-bright);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* File selected state styling */
#dropZone.file-selected {
  border-color: var(--accent-pink);
  background: rgba(255, 20, 147, 0.08);
  box-shadow: var(--neon-glow-subtle);
}