:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
}

body {
  background-color: #121212;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  border-bottom: 2px solid var(--primary-color);
}

.card {
  border: none;
  background-color: #1e1e1e;
}

.card-header {
  border-bottom: 1px solid #333;
}

.progress {
  background-color: #2d2d2d;
}

.progress-bar {
  transition: width 0.3s ease;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0b5ed7;
  transform: translateY(-2px);
}

.form-control {
  background-color: #2d2d2d;
  border-color: #444;
  color: #fff;
}

.form-control:focus {
  background-color: #333;
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-text {
  color: #aaa;
}

.file-card {
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary-color);
}

.file-card:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.file-icon {
  font-size: 2.5rem;
}

.video-icon {
  color: #ff0000; /* YouTube red */
}

.audio-icon {
  color: #1db954; /* Spotify green */
}

.trimmed-icon {
  color: #f39c12; /* Orange */
}

#activeDownloads .download-item {
  padding: 10px;
  margin-bottom: 10px;
  background-color: #2d2d2d;
  border-radius: 5px;
  border-left: 4px solid var(--info-color);
}

.download-status {
  font-size: 0.9rem;
  padding: 2px 8px;
  border-radius: 3px;
}

.status-downloading {
  background-color: var(--info-color);
  color: white;
}

.status-processing {
  background-color: var(--warning-color);
  color: black;
}

.status-completed {
  background-color: var(--success-color);
  color: white;
}

.status-error {
  background-color: var(--danger-color);
  color: white;
}

footer {
  margin-top: auto;
  border-top: 2px solid #333;
}

/* Animations */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Add these styles to your existing CSS */
/* Active downloads list styles */
.downloads-list .list-group-item {
  background-color: #2d2d2d;
  border-color: #444;
  color: #e0e0e0;
  margin-bottom: 5px;
  transition: all 0.2s ease;
  border-radius: 5px;
}

.downloads-list .list-group-item:hover {
  background-color: #3d3d3d;
  transform: translateX(3px);
  cursor: pointer;
}

.downloads-list .list-group-item.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Status badges */
.badge.bg-info {
  background-color: var(--info-color) !important;
}

.badge.bg-warning {
  background-color: var(--warning-color) !important;
  color: #000;
}

.badge.bg-success {
  background-color: var(--success-color) !important;
}

.badge.bg-danger {
  background-color: var(--danger-color) !important;
}

.badge.bg-secondary {
  background-color: var(--secondary-color) !important;
}

/* File cards */
.file-card {
  transition: all 0.3s ease;
  border-left: 4px solid;
}

.file-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Modal customization */
.btn-close-white {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Progress bars in active downloads */
.downloads-list .progress {
  background-color: #1a1a1a;
  margin-top: 8px;
}

.downloads-list .progress-bar {
  border-radius: 3px;
}

/* Main Styles */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Media Cards */
.media-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  overflow: hidden;
  height: 100%;
}

.media-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border-color: var(--bs-primary);
}

.media-card.video {
  border-left: 4px solid var(--bs-danger);
}

.media-card.audio {
  border-left: 4px solid var(--bs-success);
}

.media-card.other {
  border-left: 4px solid var(--bs-secondary);
}

.media-thumbnail {
  height: 180px;
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.media-thumbnail.video::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(220, 53, 69, 0.2), transparent);
}

.media-thumbnail.audio::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(25, 135, 84, 0.2), transparent);
}

.media-icon {
  font-size: 3rem;
  z-index: 1;
}

.video .media-icon {
  color: var(--bs-danger);
}

.audio .media-icon {
  color: var(--bs-success);
}

.media-info {
  padding: 1rem;
}

.media-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-meta {
  font-size: 0.8rem;
  color: var(--bs-secondary);
}

.media-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.media-card:hover .media-actions {
  opacity: 1;
}

/* Player Styling */
.media-player {
  width: 100%;
  border-radius: 8px;
  background: var(--bs-dark);
}

.audio-player-container {
  padding: 2rem;
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
  border-radius: 10px;
}

.audio-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  margin: 1rem 0;
}

.audio-wave-bar {
  width: 4px;
  height: 20px;
  background: var(--bs-info);
  margin: 0 2px;
  border-radius: 2px;
  animation: wave 1s ease-in-out infinite;
}

.audio-wave-bar:nth-child(2) {
  animation-delay: 0.1s;
}
.audio-wave-bar:nth-child(3) {
  animation-delay: 0.2s;
}
.audio-wave-bar:nth-child(4) {
  animation-delay: 0.3s;
}
.audio-wave-bar:nth-child(5) {
  animation-delay: 0.4s;
}

@keyframes wave {
  0%,
  100% {
    height: 20px;
  }
  50% {
    height: 40px;
  }
}

/* Table Styling */
.table-hover tbody tr:hover {
  background-color: var(--bs-table-hover-bg);
  cursor: pointer;
}

.type-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

/* Loading Animation */
.loading-spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 3px solid rgba(var(--bs-primary-rgb), 0.3);
  border-radius: 50%;
  border-top-color: var(--bs-primary);
  animation: spin 1s ease-in-out infinite;
}

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

/* File type colors */
.bg-video {
  background-color: rgba(220, 53, 69, 0.2) !important;
  color: #dc3545 !important;
}

.bg-audio {
  background-color: rgba(25, 135, 84, 0.2) !important;
  color: #198754 !important;
}

/* Progress bar for file operations */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: none;
}

/* Empty state styling */
.empty-state-icon {
  font-size: 4rem;
  opacity: 0.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .media-thumbnail {
    height: 150px;
  }

  .media-icon {
    font-size: 2rem;
  }

  .col-lg-3 {
    margin-bottom: 1rem;
  }
}

/* Print styles */
@media print {
  .media-actions,
  .btn,
  .navbar,
  .footer,
  .card-header {
    display: none !important;
  }
}

/* Focus styles for accessibility */
:focus {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Custom button styles */
.btn-play {
  background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
  border: none;
  color: white;
  transition: all 0.3s ease;
}

.btn-play:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(13, 110, 253, 0.4);
}

/* Card hover effects */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}
