/* Video Page Specific Styles */

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navbar Styles */
.navbar {
  background: var(--bg-primary);
  box-shadow: var(--shadow);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.navbar .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.navbar h1 {
  margin: 0;
  color: var(--text-primary);
}

.site-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.last-updated {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: normal;
  margin-left: 50px; /* Align with text after logo */
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-links a:hover {
  background: var(--bg-secondary);
  text-decoration: none;
}

.user-info {
  color: var(--text-secondary);
  font-size: 14px;
}

.user-info a {
  color: var(--accent-color);
  text-decoration: none;
  margin-left: 15px;
}

.user-info a:hover {
  text-decoration: underline;
}


/* Above the Fold Layout */
.above-fold {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 10px;
  max-width: 100%;
  margin: 0;
  width: 100%;
  padding-top: 70px; /* Account for theme toggle */
}

/* Video Player */
.video-player {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
  width: 100%;
}

/* 16:9 Aspect Ratio Container */
.video-player iframe {
  width: min(90vw, 70vh * (16/9));
  height: min(90vw * (9/16), 70vh);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  border: none;
}

/* Controls Row Layout */
.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.add-category-section {
  flex-shrink: 0;
}

.rating-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.skip-section {
  flex-shrink: 0;
}

/* Current Categories Row */
.current-categories-row {
  margin-bottom: 15px;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  min-height: 30px;
  display: flex;
  align-items: center;
}

.star-rating {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 5px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  padding: 5px;
  transition: all 0.2s ease;
  position: relative;
}

.star-icon {
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: inline-block;
  text-shadow: 0 0 0 transparent;
}

.star-btn:hover .star-icon,
.star-btn.hovered .star-icon {
  color: var(--star-color);
  transform: scale(1.2);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.star-btn.clicked .star-icon {
  transform: scale(1.4) rotate(72deg);
  color: #ff6b35;
}

.star-btn.rated .star-icon {
  animation: ratingPulse 0.6s ease-out;
  color: var(--star-color);
}

@keyframes ratingPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.current-rating {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.rating-text {
  color: var(--star-color);
  font-weight: bold;
}

.rating-count {
  color: var(--text-muted);
  margin-left: 5px;
}


.skip-btn {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.skip-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: white;
}

/* Video Info Below Controls */
.video-info {
  margin-top: 15px;
}

.video-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 10px 0;
}

/* Description Preview */
.description-preview {
  background: var(--bg-secondary);
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
}

.description {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.6;
}

.expand-btn {
  background: none;
  border: none;
  color: var(--accent-color);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin-top: 10px;
  padding: 0;
}

.expand-btn:hover {
  text-decoration: underline;
}


.current-categories-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  align-items: center;
}

.category-tag-mini {
  display: inline-flex;
  align-items: center;
  background: var(--success-color);
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
}

.remove-category-mini-btn {
  background: none;
  border: none;
  color: white;
  margin-left: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.remove-category-mini-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.no-categories-mini {
  color: var(--text-muted);
  font-style: italic;
  font-size: 14px;
}

.add-category-quick-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.add-category-quick-btn:hover {
  background: var(--accent-hover);
}

/* Quick Category Dropdown */
.category-quick-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  min-width: 280px;
  max-width: 350px;
  margin-bottom: 5px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.quick-dropdown-section {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.quick-dropdown-section:last-child {
  border-bottom: none;
}

/* Make the first section (existing categories) scrollable */
.quick-dropdown-section:first-child {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.quick-dropdown-section:first-child .quick-category-option {
  flex-shrink: 0;
}

/* Custom scrollbar for category list */
.quick-dropdown-section:first-child::-webkit-scrollbar {
  width: 6px;
}

.quick-dropdown-section:first-child::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.quick-dropdown-section:first-child::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 3px;
}

.quick-dropdown-section:first-child::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

.quick-dropdown-section h4 {
  margin: 0 0 8px 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.quick-category-option {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  margin-bottom: 2px;
  font-size: 13px;
  transition: background 0.2s;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-category-option:hover {
  background: var(--bg-secondary);
}

.no-quick-categories {
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
  margin: 0;
  text-align: center;
  padding: 8px;
}

.quick-category-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.quick-category-form input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.quick-category-form input:focus {
  outline: none;
  border-color: var(--accent-color);
}

#quick-create-btn {
  background: var(--success-color);
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.3s;
}

#quick-create-btn:hover {
  background: var(--success-color);
  filter: brightness(0.9);
}

/* Below the Fold Content */
.below-fold {
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.below-fold > div {
  margin-bottom: 40px;
}

.below-fold h3 {
  color: var(--text-primary);
  font-size: 1.3rem;
  margin-bottom: 20px;
  font-weight: 600;
}

/* Description Full */
.description-full {
  background: var(--bg-secondary);
  padding: 25px;
  border-radius: 12px;
  border-left: 4px solid var(--accent-color);
}

.description-content {
  color: var(--text-primary);
  line-height: 1.7;
}

/* Categories Section */

/* Keywords Section */
.keywords-section {
  background: var(--bg-secondary);
  padding: 25px;
  border-radius: 12px;
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-tag {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
}

/* Download Links */
.download-links {
  background: var(--bg-secondary);
  padding: 25px;
  border-radius: 12px;
  border-left: 4px solid var(--success-color);
}

.download-link {
  margin-bottom: 10px;
}

.link-btn {
  display: inline-block;
  padding: 10px 16px;
  background: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  min-width: 180px;
  text-align: center;
}

.link-btn:hover {
  background: var(--accent-hover);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Transcript Section */
.transcript-section {
  background: var(--bg-secondary);
  padding: 25px;
  border-radius: 12px;
  border-left: 4px solid var(--accent-color);
}

.transcript-content {
  max-height: 400px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  padding: 15px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.transcript-content::-webkit-scrollbar {
  width: 8px;
}

.transcript-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.transcript-content::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 4px;
}

.transcript-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

/* Source Info */
.source-info {
  text-align: center;
  padding: 20px;
}

.source {
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* No Videos State */
.no-videos {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin: 40px 20px;
}

.no-videos h2 {
  color: var(--text-primary);
  margin-bottom: 15px;
}

.no-videos code {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 4px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .above-fold {
    padding: 10px;
    padding-top: 60px;
    min-height: calc(100vh - 60px);
  }
  
  .category-quick-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    max-width: 90vw;
    max-height: 60vh;
  }
  
  .quick-dropdown-section:first-child {
    max-height: 150px;
  }
  
  .video-player {
    margin-bottom: 10px;
  }
  
  .video-player iframe {
    width: min(95vw, 55vh * (16/9));
    height: min(95vw * (9/16), 55vh);
    border-radius: 6px;
  }
  
  .controls-row {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 8px;
  }
  
  .add-category-section {
    width: 100%;
    text-align: center;
  }
  
  .star-rating {
    gap: 5px;
  }
  
  .star-btn {
    font-size: 24px;
    padding: 3px;
  }
  
  .skip-btn {
    width: 80%;
    text-align: center;
    padding: 12px;
  }
  
  .video-title {
    font-size: 1.2rem;
  }
  
  .current-categories-row {
    text-align: center;
  }
  
  
  .add-category-quick-btn {
    width: 80%;
    padding: 12px;
  }
  
  .skip-section {
    width: 100%;
    text-align: center;
  }
  
  .below-fold {
    padding: 20px 15px;
  }
  
  .navbar .container {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .last-updated {
    margin-left: 0; /* Remove left margin on mobile */
    text-align: center;
  }
  
  .nav-links {
    justify-content: center;
  }
  
}

/* Tag Filter Section Styles */
.tag-filter-section {
  position: relative;
  margin-bottom: 20px;
}

.tag-filter-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.tag-filter-toggle-btn:hover {
  background: var(--bg-tertiary);
}

.filter-active-indicator {
  color: #007bff;
  font-size: 12px;
  margin-left: 5px;
}

.tag-filter-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 1000;
  margin-top: 5px;
}

.tag-filter-controls {
  padding: 20px;
}

.filter-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.filter-group {
  flex: 1;
}

.filter-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

.filter-actions {
  display: flex;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.clear-filters-btn,
.apply-filters-btn {
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.clear-filters-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.clear-filters-btn:hover {
  background: var(--bg-tertiary);
}

.apply-filters-btn {
  background: #007bff;
  border: 1px solid #007bff;
  color: white;
}

.apply-filters-btn:hover {
  background: #0056b3;
}

/* Responsive adjustments for tag filter */
@media (max-width: 768px) {
  .filter-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .tag-filter-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    border-radius: 0;
    z-index: 2000;
    overflow-y: auto;
  }
  
  .tag-filter-controls {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .above-fold {
    padding: 10px;
  }
  
  
  .star-btn {
    font-size: 20px;
  }
  
  .below-fold {
    padding: 15px 10px;
  }
  
  .video-categories-section,
  .keywords-section,
  .download-links,
  .transcript-section,
  .description-full {
    padding: 15px;
  }
}