:root {
  --primary-color: #134F5B;
  --light-text: #f3f4f6;
  --dark-text: #6b7280;
  --light-bg: white;
  --dark-bg: #1f2937;
  --dark-component-bg: #374151;
  --border-radius: 0.5rem;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Base styles */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 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;
}

/* Filters */
.filter-options {
  margin-bottom: 1.5rem;
}

.cc-filter input[type="checkbox"],
.cc-filter label {
  cursor: pointer;
}

.cc-filter label {
  user-select: none;
}

/* Video items */
.video-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background-color: var(--light-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.video-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.video-details h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.video-meta {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--dark-text);
}

/* Thumbnails */
.thumbnail {
  flex-shrink: 0;
  position: relative;
}

.thumbnail-img {
  width: 320px;
  height: 180px;
  object-fit: cover;
  border-radius: 0.25rem;
}

/* Video source badges */
.video-source {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.source-youtube {
  background-color: #FF0000; /* YouTube red */
}

.source-vimeo {
  background-color: #1AB7EA; /* Vimeo blue */
}

/* License badge */
.license-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  background-color: #559E54; /* Green color for license badges */
}

/* Loading animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

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

.loading-indicator svg {
  animation: spin 1s linear infinite;
}

.loading-pulse {
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Load more button loading state */
.load-more.loading {
  position: relative;
  padding-left: 2.5rem;
  opacity: 0.8;
  cursor: not-allowed;
}

.load-more.loading::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 50%;
  margin-top: -0.5rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
}

/* Media queries */
@media (max-width: 640px) {
  /* Layout adjustments */
  .search-container .flex,
  .video-item {
    flex-direction: column;
  }
  
  /* Thumbnail adjustments */
  .thumbnail {
    width: 100%;
  }
  
  .thumbnail-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--dark-bg);
    color: var(--light-text);
  }
  
  .video-item {
    background-color: var(--dark-component-bg);
  }
  
  .video-details h4 a {
    color: var(--primary-color);
  }
  
  .video-details p {
    color: #d1d5db;
  }
  
  .video-meta {
    color: #9ca3af;
  }
  
  .search-bar {
    background-color: var(--dark-component-bg);
    color: var(--light-text);
  }
  
  input::placeholder {
    color: #9ca3af;
  }
  
  .error-container {
    background-color: #7f1d1d;
    color: #fecaca;
  }
}

/* Title and accents */
h1.text-4xl {
  color: var(--primary-color);
}

.search-button {
  background-color: var(--primary-color);
}

.search-button:hover {
  background-color: #0F3E48;
}

#debug-banner {
  background-color: var(--primary-color);
  color: #FFFFFF;
}