/* Mobile Video App Styles - TikTok/Instagram-style mobile video interface
 * Defines mobile-specific CSS variables, video player layout, overlay controls,
 * action buttons (like/dislike/comment), responsive design, and mobile interactions
 *END_DESCRIPTION
 */

/* Mobile Video App Styles - TikTok/Instagram Style */

/* Mobile-specific variables - inherits theme from application.css */

/* Base Mobile App Container */
.mobile-video-app {
  background: var(--mobile-bg);
  color: var(--mobile-text-primary);
  height: 100vh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
}

/* Mobile Header */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  z-index: 100;
  border-bottom: 1px solid var(--mobile-border);
}

/* Header Navigation Container */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  height: 100%;
}

/* Common Header Item Styling */
.header-item {
  background: none;
  border: none;
  color: var(--mobile-text-secondary);
  font-size: 16px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 44px;
}

.header-item:hover {
  color: var(--mobile-text-primary);
  transform: scale(1.05);
}

/* Hamburger and Search Button Specific */
.header-item.hamburger-btn,
.header-item.search-btn {
  font-size: 18px;
  min-width: 40px;
  color: var(--mobile-text-primary);
}

.header-item.hamburger-btn:hover,
.header-item.search-btn:hover {
  color: var(--mobile-accent);
}

/* Navigation Tab Specific Styling */
.header-item.nav-tab {
  font-weight: 600;
  position: relative;
  font-size: 14px;
}

.header-item.nav-tab.active {
  color: var(--mobile-text-primary);
}

.header-item.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--mobile-accent);
  border-radius: 1px;
}

.indicator-dot {
  position: absolute;
  top: 6px;
  right: 2px;
  width: 6px;
  height: 6px;
  background-color: #ff4444;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(255, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
  }
}

/* All Done Slide */
.all-done-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--mobile-bg);
}

.all-done-content {
  text-align: center;
  padding: 40px 20px;
  max-width: 400px;
}

.all-done-icon {
  font-size: 64px;
  color: var(--mobile-accent);
  margin-bottom: 20px;
}

.all-done-content h2 {
  color: var(--mobile-text-primary);
  font-size: 24px;
  margin-bottom: 10px;
}

.all-done-content p {
  color: var(--mobile-text-secondary);
  font-size: 16px;
  margin-bottom: 30px;
}

.all-done-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.all-done-actions button {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.all-done-actions .btn-primary {
  background: var(--mobile-accent);
  color: white;
  border: none;
}

.all-done-actions .btn-secondary {
  background: transparent;
  color: var(--mobile-text-primary);
  border: 2px solid var(--mobile-text-secondary);
}


/* Hamburger Menu Dropdown */
.hamburger-menu {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(15px);
  z-index: 99;
  display: none;
  border-bottom: 1px solid var(--mobile-border);
}

.hamburger-menu.open {
  display: block;
  animation: slideDownFade 0.3s ease;
}

.hamburger-menu-content {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  gap: 8px;
}

.menu-item {
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--mobile-text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-item:hover {
  background: var(--mobile-accent);
  color: white;
  transform: translateX(4px);
}

.menu-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Video Container */
.video-container {
  margin-top: var(--header-height);
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-height));
}

/* Video Player */
.video-player {
  width: 100%;
  min-height: 19vh;
  max-height: 28vh;
  position: relative;
  background: #000;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.video-player iframe,
.video-player video {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
  max-height: 40vh;
  z-index: 10;
  pointer-events: auto;
  position: relative;
}

/* Star Rating Overlay (Right Side) */
.rating-overlay {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 50;
}

.rating-star-overlay {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.rating-star-overlay .star-icon {
  font-size: 24px;
  color: var(--mobile-text-muted);
  transition: all 0.3s ease;
}

.rating-star-overlay:hover .star-icon,
.rating-star-overlay.active .star-icon {
  color: var(--star-rating);
  transform: scale(1.2);
}

.rating-star-overlay:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: var(--star-rating);
  transform: scale(1.1);
}

.rating-display-overlay {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  margin-top: 8px;
}

.rating-text-overlay {
  color: var(--star-rating);
  font-weight: 700;
  font-size: 14px;
}

.rating-count-overlay {
  color: var(--mobile-text-secondary);
  font-size: 12px;
  margin-top: 2px;
}

/* Like/Dislike Rating Styles for Action Buttons */
.like-action-btn.active,
.like-action-btn.active svg {
  color: #4caf50 !important;
  fill: #4caf50 !important;
}

.dislike-action-btn.active,
.dislike-action-btn.active svg {
  color: #f44336 !important;
  fill: #f44336 !important;
}

.like-action-btn:hover {
  background: rgba(76, 175, 80, 0.1);
}

.dislike-action-btn:hover {
  background: rgba(244, 67, 54, 0.1);
}

.like-action-btn.clicked,
.dislike-action-btn.clicked {
  animation: actionBtnClick 0.3s ease;
}

@keyframes actionBtnClick {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Content Section */
.content-section {
  flex: 1;
  display: flex;
  background: var(--mobile-bg);
  overflow: hidden;
  border-top: 1px solid var(--mobile-border);
  height: 30vh;
}

.content-main {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.content-actions {
  width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 8px;
  gap: 16px;
  background: var(--mobile-surface);
  border-left: 1px solid var(--mobile-border);
}

.content-actions .action-btn {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  color: var(--mobile-text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.content-actions .action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.content-actions .action-btn svg {
  width: 20px;
  height: 20px;
}

.content-actions .action-count {
  font-size: 10px;
  font-weight: bold;
  margin-top: 2px;
}


/* Content Sections */
.description-section,
.transcript-section,
.video-info-section {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--mobile-surface);
  border-radius: 8px;
  border: 1px solid var(--mobile-border);
}

.description-section h4,
.transcript-section h4 {
  color: var(--mobile-text-primary);
  font-size: 16px;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.description-text,
.transcript-text {
  color: var(--mobile-text-secondary);
  line-height: 1.5;
}

.description-preview,
.description-full,
.transcript-preview,
.transcript-full {
  font-size: 14px;
  margin: 0;
  transition: opacity 0.3s ease, max-height 0.3s ease;
  overflow: hidden;
}

.expand-btn {
  background: none;
  border: none;
  color: var(--mobile-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 8px;
  padding: 0;
}

.expand-btn:hover {
  color: var(--mobile-accent-hover);
}

/* Video Info Section */
.video-info-section {
  background: var(--mobile-surface-variant);
}

.video-filename {
  font-size: 14px;
  color: var(--mobile-text-primary);
  margin-bottom: 12px;
  font-family: monospace;
}

.video-tags {
  margin-bottom: 12px;
}

.video-tags strong {
  color: var(--mobile-text-primary);
  font-size: 14px;
  display: block;
  margin-bottom: 8px;
}

.video-tag {
  display: inline-block;
  background: var(--tag-bg);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px 4px 2px 0;
}

.trend-score {
  color: var(--mobile-text-secondary);
  font-size: 14px;
}

.trend-score strong {
  color: var(--mobile-text-primary);
}

.trend-value {
  color: var(--mobile-accent);
  font-weight: 700;
}

/* Category Popup and Tag Filter Popup */
.category-popup,
.tag-filter-popup {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.popup-content {
  background: var(--mobile-surface);
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--mobile-border);
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.popup-header h3 {
  margin: 0;
  color: var(--mobile-text-primary);
  font-size: 18px;
}

.close-popup {
  background: none;
  border: none;
  color: var(--mobile-text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

.current-categories,
.available-categories {
  margin-bottom: 20px;
}

.create-category {
  margin-top: 30px;
  margin-bottom: 40px;
}

.current-categories h4,
.available-categories h4,
.create-category h4 {
  color: var(--mobile-text-primary);
  font-size: 14px;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-tag {
  display: inline-block;
  position: relative;
  background: var(--category-bg);
  color: white;
  padding: 8px 24px 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  margin: 4px 4px 4px 0;
}

.remove-category-btn {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ff4444;
  border: 2px solid white;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.category-option {
  display: block;
  width: 100%;
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  color: var(--mobile-text-primary);
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.category-option:hover {
  background: var(--mobile-accent);
  color: white;
}

.create-form {
  display: flex;
  gap: 12px;
}

.create-form input {
  flex: 1;
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  color: var(--mobile-text-primary);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

.create-form button {
  background: var(--mobile-accent);
  border: none;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

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

/* Tag Filter Specific Styles */
.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.tag-filter-btn {
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  color: var(--mobile-text-primary);
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
}

.tag-filter-btn:hover:not(.include):not(.exclude) {
  background: var(--mobile-surface);
  color: var(--mobile-text-primary);
  transform: scale(1.05);
}

.tag-filter-btn.include {
  background: var(--category-bg) !important;
  color: white !important;
  border-color: var(--category-bg) !important;
}

.tag-filter-btn.exclude {
  background: var(--mobile-accent) !important;
  color: white !important;
  border-color: var(--mobile-accent) !important;
}

/* Explicitly reset neutral state */
.tag-filter-btn:not(.include):not(.exclude) {
  background: var(--mobile-surface-variant) !important;
  color: var(--mobile-text-primary) !important;
  border-color: var(--mobile-border) !important;
}

.filter-display {
  background: var(--mobile-surface-variant);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.include-tags,
.exclude-tags {
  margin-bottom: 10px;
}

.include-tags:last-child,
.exclude-tags:last-child {
  margin-bottom: 0;
}

.filter-tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin: 2px 4px 2px 0;
}

.filter-tag.include-tag {
  background: var(--category-bg);
  color: white;
}

.filter-tag.exclude-tag {
  background: var(--mobile-accent);
  color: white;
}

.filter-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.clear-filters-btn,
.apply-filters-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.clear-filters-btn {
  background: var(--mobile-surface-variant);
  color: var(--mobile-text-primary);
  border: 1px solid var(--mobile-border);
}

.apply-filters-btn {
  background: var(--mobile-accent);
  color: white;
}

.clear-filters-btn:hover {
  background: var(--mobile-border);
}

.apply-filters-btn:hover {
  background: var(--mobile-accent-hover);
}

/* Filter Indicator on Settings Button */
.filter-indicator {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--mobile-accent);
  border-radius: 50%;
  font-size: 8px;
  color: var(--mobile-accent);
}

/* Transcript Scroll Container */
.transcript-scroll {
  max-height: 120px;
  overflow-y: auto;
  padding: 8px;
  background: var(--mobile-surface-variant);
  border-radius: 6px;
  border: 1px solid var(--mobile-border);
  margin-top: 8px;
}

/* Tag Filter Panel (Hidden by default) */
.tag-filter-section {
  position: fixed;
  top: var(--header-height);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--mobile-surface);
  border-bottom: 1px solid var(--mobile-border);
  z-index: 90;
}

.tag-filter-toggle-btn {
  display: none;
}

.tag-filter-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--mobile-surface);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--mobile-border);
  background: var(--mobile-surface-variant);
}

.panel-header h3 {
  margin: 0;
  color: var(--mobile-text-primary);
  font-size: 18px;
  font-weight: 600;
}

.close-panel-btn {
  background: none;
  border: none;
  color: var(--mobile-text-secondary);
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.close-panel-btn:hover {
  background: var(--mobile-surface);
  color: var(--mobile-text-primary);
}

.tag-search-section {
  padding: 16px;
  border-bottom: 1px solid var(--mobile-border);
}

.tag-search-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  border-radius: 8px;
  color: var(--mobile-text-primary);
  font-size: 16px;
}

.tag-search-input::placeholder {
  color: var(--mobile-text-muted);
}

.filter-controls-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.filter-controls-scrollable h4 {
  margin: 0 0 12px 0;
  color: var(--mobile-text-primary);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-grid-scrollable {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}

.current-filters-section {
  padding: 16px;
  border-top: 1px solid var(--mobile-border);
  border-bottom: 1px solid var(--mobile-border);
}

.current-filters-section h4 {
  margin: 0 0 12px 0;
  color: var(--mobile-text-primary);
  font-size: 14px;
  font-weight: 600;
}

.filter-actions-fixed {
  padding: 16px;
  background: var(--mobile-surface-variant);
  border-top: 1px solid var(--mobile-border);
  display: flex;
  gap: 12px;
}

.clear-filters-btn,
.apply-filters-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.clear-filters-btn:hover {
  background: var(--mobile-surface-variant);
  color: var(--mobile-text-primary);
}

.apply-filters-btn {
  background: var(--mobile-accent);
  color: white;
}

.apply-filters-btn:hover {
  background: var(--mobile-accent-hover);
}

.category-panel,
.comments-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--mobile-surface);
}

/* Category panel content area - scrollable */
.category-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 0; /* Allow flex item to shrink */
}

/* Comments Panel Specific Styles */
.comments-list-section {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 0; /* Allow flex item to shrink */
}

.comment-form-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--mobile-border);
  background: var(--mobile-surface-variant);
  flex-shrink: 0; /* Prevent form from shrinking */
  position: sticky;
  bottom: 0;
}

.comment-form-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.comment-input-bar {
  flex: 1;
  padding: 10px 12px;
  background: var(--mobile-surface);
  border: 1px solid var(--mobile-border);
  border-radius: 20px;
  color: var(--mobile-text-primary);
  font-size: 14px;
  font-family: inherit;
}

.comment-input-bar::placeholder {
  color: var(--mobile-text-muted);
}

.comment-input-bar:focus {
  outline: none;
  border-color: var(--mobile-accent);
  box-shadow: 0 0 0 2px rgba(254, 44, 85, 0.1);
}

.submit-comment-btn-bar {
  background: var(--mobile-accent);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.submit-comment-btn-bar:hover:not(:disabled) {
  background: var(--mobile-accent-hover);
  transform: scale(1.05);
}

.submit-comment-btn-bar:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  border-radius: 8px;
  padding: 12px 16px;
  position: relative;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 600;
  color: var(--mobile-text-primary);
  font-size: 14px;
}

.comment-time {
  font-size: 12px;
  color: var(--mobile-text-muted);
}

.comment-content {
  color: var(--mobile-text-primary);
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.no-comments,
.error-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--mobile-text-muted);
}

.loading-comments {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--mobile-text-muted);
}

.loading-comments .loading-spinner {
  margin-bottom: 16px;
}

/* Responsive Design */
@media (max-width: 480px) {
  .mobile-video-app {
    max-width: 100%;
  }
  
  .mobile-header {
    max-width: 100%;
  }
  
  .category-popup {
    max-width: 100%;
  }
  
  .popup-content {
    width: 95%;
    padding: 20px;
  }
  
  .rating-overlay {
    right: 12px;
    gap: 10px;
  }
  
  .rating-star-overlay {
    width: 40px;
    height: 40px;
  }
  
  .rating-star-overlay .star-icon {
    font-size: 20px;
  }
  
  .rating-thumb-overlay {
    width: 40px;
    height: 40px;
  }
  
  .rating-thumb-overlay .thumb-icon {
    font-size: 20px;
  }
  
  .content-actions {
    width: 56px;
    padding: 12px 6px;
    gap: 12px;
  }
  
  .content-actions .action-btn {
    width: 40px;
    height: 40px;
  }
  
  .content-main {
    padding: 12px;
  }
  
  .description-section,
  .transcript-section,
  .video-info-section {
    margin-bottom: 12px;
    padding: 10px;
  }
}

/* Video Content Wrapper - Container for content and actions */
.video-content-wrapper {
  display: flex;
  background: var(--mobile-surface);
  border-bottom: 1px solid var(--mobile-border);
  min-height: 120px;
  flex: 1;
}

/* Video Content Info Section - Left side */
.video-content-info {
  flex: 1;
  padding: 16px 20px;
  color: var(--mobile-text-primary);
}

.video-content-info .video-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--mobile-text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
  word-break: break-word;
}

.video-content-info .video-description {
  margin-bottom: 12px;
}

.video-content-info .description-text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--mobile-text-secondary);
  word-break: break-word;
}

/* Transcript Button Section */
.transcript-section {
  margin-bottom: 12px;
}

.transcript-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--mobile-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.transcript-toggle:hover {
  background: var(--mobile-surface-hover);
}

.transcript-toggle .transcript-icon {
  color: var(--mobile-text-secondary);
  flex-shrink: 0;
  margin-right: 8px;
  font-size: 14px;
}

/* Trend Score */
.video-content-info .video-trend-score {
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(255, 193, 7, 0.1);
  border-radius: 6px;
  font-size: 13px;
}

.video-content-info .trend-label {
  color: var(--mobile-text-secondary);
}

.video-content-info .trend-value {
  color: #ffc107;
  font-weight: 600;
}

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

.video-content-info .video-tag {
  background: var(--mobile-surface-variant);
  color: var(--mobile-text-secondary);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid var(--mobile-border);
}

/* Content Actions - Right side vertical buttons */
.content-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--mobile-surface);
  min-width: 60px;
}

.content-action-btn {
  background: none;
  border: none;
  color: var(--mobile-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 8px;
  min-width: 40px;
  font-size: 20px;
  position: relative;
}

.content-action-btn:hover {
  background: var(--mobile-surface-hover);
  transform: scale(1.05);
}

.content-action-btn i {
  transition: all 0.2s ease;
  font-size: 18px;
}

.content-action-btn .action-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--mobile-text-muted);
  min-height: 14px;
  line-height: 1;
}

/* Like/Dislike specific styles */
.content-action-btn.like-action-btn.active,
.content-action-btn.like-action-btn.active i {
  color: #4caf50 !important;
}

.content-action-btn.dislike-action-btn.active,
.content-action-btn.dislike-action-btn.active i {
  color: #f44336 !important;
}

.content-action-btn.like-action-btn:hover {
  color: #4caf50;
}

.content-action-btn.dislike-action-btn:hover {
  color: #f44336;
}

.content-action-btn.clicked {
  animation: contentBtnClick 0.3s ease;
}

@keyframes contentBtnClick {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Filter Indicator Dot */
.filter-indicator {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: #f44336;
  border-radius: 50%;
  border: 1px solid var(--mobile-surface);
  animation: filterPulse 2s infinite;
}

@keyframes filterPulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

/* Animation for expand/collapse */
@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    padding: 0 16px;
  }
  to {
    opacity: 1;
    max-height: 500px;
    padding: 16px;
  }
}

/* Smooth Transitions and Animations */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Removed universal transition that was causing performance issues
   Individual elements should define their own transitions as needed */

/* Loading State */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--mobile-border);
  border-top: 3px solid var(--mobile-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

/* PWA Optimization */
@media (display-mode: standalone) {
  .mobile-header {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--header-height) + env(safe-area-inset-top));
  }
  
  .video-container {
    margin-top: calc(var(--header-height) + env(safe-area-inset-top));
    height: calc(100vh - var(--header-height) - env(safe-area-inset-top));
  }
}

/* Hide original elements that conflict with mobile design */
.theme-toggle {
  display: none;
}

.navbar {
  display: none;
}

/* Show navbar on search pages - mobile and desktop */
body.search-page .navbar {
  display: block !important;
}

/* Ensure app fills entire viewport on mobile */
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
}

html {
  overflow: hidden;
  height: 100vh;
}

/* Rating Action Button Styling */
.rating-btn .action-count {
  color: #FFD700 !important;
  font-weight: 700;
}

/* Hide the big center play button overlay */
video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none;
}
video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

/* Ensure the small play button in controls is visible */
video::-webkit-media-controls-play-button {
  display: block !important;
}

/* Ensure control panel is visible */
video::-webkit-media-controls-panel {
  display: flex !important;
}

/* Disabled navigation tabs */
.nav-tab.disabled {
  opacity: 0.4 !important;
  color: #666666 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.nav-tab.disabled:hover {
  background: none !important;
  transform: none !important;
}



/* Search page overrides - must be after the general rules */
body.search-page {
  overflow: auto !important;
  overflow-y: scroll !important;
  height: auto !important;
  max-height: none !important;
  min-height: 100vh !important;
  position: static !important;
}

/* Also override html for search pages */
html:has(body.search-page) {
  overflow: auto !important;
  overflow-y: scroll !important;
  height: auto !important;
  max-height: none !important;
}

/* Settings Panel */
.settings-panel {
  position: fixed;
  bottom: -450px;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--mobile-surface);
  border-top: 2px solid var(--mobile-accent);
  border-radius: 16px 16px 0 0;
  transition: bottom 0.3s ease-out;
  z-index: 999;
  height: 500px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.settings-panel.open {
  bottom: 0;
}

.settings-panel-handle {
  width: 40px;
  height: 4px;
  background: var(--mobile-text-secondary);
  border-radius: 2px;
  margin: 12px auto 8px auto;
  cursor: pointer;
}

.settings-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 16px 20px;
  border-bottom: 1px solid var(--mobile-border);
}

.settings-panel-title {
  color: var(--mobile-text-primary);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.settings-close-btn {
  background: none;
  border: none;
  color: var(--mobile-text-secondary);
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.settings-close-btn:hover {
  background: var(--mobile-surface-variant);
}

.settings-content {
  padding: 20px;
  max-height: calc(80vh - 100px);
  overflow-y: auto;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section h4 {
  color: var(--mobile-text-primary);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.filter-group {
  margin-bottom: 16px;
}

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

.filter-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--mobile-border);
}

.apply-filters-btn,
.clear-filters-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.apply-filters-btn {
  background: var(--mobile-accent);
  color: white;
}

.clear-filters-btn {
  background: var(--mobile-surface-variant);
  color: var(--mobile-text-primary);
  border: 1px solid var(--mobile-border);
}

.apply-filters-btn:hover {
  background: var(--mobile-accent-hover);
}

.clear-filters-btn:hover {
  background: var(--mobile-border);
}

/* Clear filter button in no-videos context */
.no-videos .clear-filters-btn {
  flex: none;
  display: inline-block;
  width: auto;
  min-width: 120px;
  height: auto;
}

/* For You Settings Specific Styles */
.sort-select,
.sort-order-select,
.date-range-select,
.scroll-behavior-select {
  width: 100%;
  padding: 10px 12px;
  margin: 4px 0;
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  border-radius: 6px;
  color: var(--mobile-text-primary);
  font-size: 14px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 40px;
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.date-range-inputs input[type="date"] {
  flex: 1;
  padding: 10px 12px;
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  border-radius: 6px;
  color: var(--mobile-text-primary);
  font-size: 14px;
}

.date-range-inputs span {
  color: var(--mobile-text-secondary);
  font-size: 14px;
  white-space: nowrap;
}

.video-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.video-type-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.video-type-checkbox:hover {
  background: var(--mobile-surface);
  border-color: var(--mobile-accent);
}

.video-type-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--mobile-accent);
}

.video-type-checkbox span {
  color: var(--mobile-text-primary);
  font-size: 13px;
  font-weight: 500;
}

/* Tag Search and Grid */
.tag-search-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  border-radius: 6px;
  color: var(--mobile-text-primary);
  font-size: 14px;
  margin-bottom: 16px;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  max-height: 200px;
  overflow-y: auto;
}

.tag-filter-btn {
  padding: 6px 12px;
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  border-radius: 16px;
  color: var(--mobile-text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-filter-btn:hover {
  background: var(--mobile-surface);
  border-color: var(--mobile-accent);
}

.tag-filter-btn.include {
  background: var(--mobile-accent);
  color: white;
  border-color: var(--mobile-accent);
}

.tag-filter-btn.exclude {
  background: #f44336;
  color: white;
  border-color: #f44336;
}

.filter-tags-display {
  min-height: 40px;
  background: var(--mobile-surface-variant);
  border: 1px solid var(--mobile-border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.filter-tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  margin: 2px 4px 2px 0;
  position: relative;
}

.filter-tag.include-tag {
  background: var(--mobile-accent);
  color: white;
}

.filter-tag.exclude-tag {
  background: #f44336;
  color: white;
}

.filter-tag button {
  background: none;
  border: none;
  color: inherit;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 4px;
  padding: 0;
  line-height: 1;
}

/* Watched Indicator for Mobile */
.watched-indicator {
  position: absolute;
  top: 21px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #4CAF50;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(5px);
}

.watched-indicator i {
  font-size: 14px;
}

