/* Application CSS - main stylesheet with theme variables and global styles
 * Imports vertical video scroll styles and defines root CSS variables for dark/light themes
 * Contains global layout, typography, forms, buttons, and component styles
 *END_DESCRIPTION
 */

/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@import url("/assets/vertical_video_scroll-c1215d67.css");
@import url("https://use.fontawesome.com/releases/v5.3.1/css/all.css");

/* Root Variables for Theme Support - Default to Dark */
:root, 
html,
html[data-theme="dark"],
html.dark-theme {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #404040;
  --text-primary: #ffffff;
  --text-secondary: #b8b8b8;
  --text-muted: #888888;
  --border-color: #404040;
  --accent-color: #4dabf7;
  --accent-hover: #339af0;
  --success-color: #51cf66;
  --warning-color: #ffd43b;
  --danger-color: #ff6b6b;
  --star-color: #ffd700;
  --shadow: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
  
  /* Mobile-specific variables */
  --mobile-bg: #000000;
  --mobile-surface: #1a1a1a;
  --mobile-surface-variant: #2a2a2a;
  --mobile-surface-hover: #3a3a3a;
  --mobile-text-primary: #ffffff;
  --mobile-text-secondary: #b3b3b3;
  --mobile-text-muted: #666666;
  --mobile-accent: #fe2c55;
  --mobile-accent-hover: #e91e63;
  --mobile-border: #333333;
  --mobile-shadow: 0 2px 8px rgba(0,0,0,0.6);
  --mobile-shadow-lg: 0 4px 20px rgba(0,0,0,0.8);
  --star-rating: #ffd700;
  --tag-bg: #fe2c55;
  --category-bg: #25d366;
  --share-bg: #1da1f2;
  --header-height: 60px;
}

html[data-theme="light"],
[data-theme="light"],
html.light-theme {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-muted: #868e96;
  --border-color: #dee2e6;
  --accent-color: #007bff;
  --accent-hover: #0056b3;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --star-color: #ffd700;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  
  /* Mobile-specific variables for light theme */
  --mobile-bg: #ffffff;
  --mobile-surface: #f8f9fa;
  --mobile-surface-variant: #e9ecef;
  --mobile-surface-hover: #dee2e6;
  --mobile-text-primary: #212529;
  --mobile-text-secondary: #6c757d;
  --mobile-text-muted: #adb5bd;
  --mobile-accent: #ff6b35;
  --mobile-accent-hover: #e55a2b;
  --mobile-border: #dee2e6;
  --mobile-shadow: 0 2px 8px rgba(0,0,0,0.1);
  --mobile-shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
}

/* Base Theme Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  /* Removed transition for better theme switching performance */
  line-height: 1.5;
}

html {
  background-color: var(--bg-primary) !important;
  /* Removed background transition for performance */
}

/* Theme Toggle Component */
.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 40px;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  transform: scale(1.05);
}

.theme-toggle span {
  display: block;
  line-height: 1;
}

.theme-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.theme-icon {
  font-size: 24px;
  transition: transform 0.3s ease;
}

/* Mobile Theme Toggle */
@media (max-width: 768px) {
  .theme-toggle {
    top: 10px;
    right: 10px;
  }
  
  .theme-btn {
    width: 40px;
    height: 40px;
  }
  
  .theme-icon {
    font-size: 20px;
  }
}

/* Search Page Specific Styles */
.search-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 80px;
  min-height: 100vh;
}

/* Override any restrictive body/html styles for search page */
body.search-page {
  overflow: auto !important;
  height: auto !important;
  max-height: none !important;
  min-height: 100vh !important;
}

/* Ensure any container with search-container can scroll */
.search-container,
.search-container * {
  overflow: visible;
  height: auto;
  max-height: none;
}

.search-form {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

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

.search-group {
  flex: 1;
}

.search-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: var(--text-primary);
}

.search-group input[type="text"],
.search-group input[type="number"],
.search-group input[type="date"],
.search-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.checkbox-item {
  display: inline-block;
  margin-right: 15px;
  margin-bottom: 5px;
}

.checkbox-item input[type="checkbox"] {
  margin-right: 5px;
}

.sort-select {
  width: 48%;
  margin-right: 4%;
}

.sort-select:last-child {
  margin-right: 0;
}

.search-actions {
  text-align: center;
  margin-top: 20px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin: 0 10px;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--text-secondary);
  color: white;
}

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

.search-results {
  min-height: 100px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

h2 {
  color: var(--text-primary);
}

/* Tag Selector Components */
.tag-selector {
  position: relative;
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-primary);
}

.tag-display {
  flex: 1;
  padding: 8px;
  min-height: 20px;
  cursor: pointer;
}

.tag-display .placeholder {
  color: var(--text-muted);
}

.tag-selector-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-left: 1px solid var(--border-color);
  color: var(--text-primary);
}

.tag-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: var(--shadow-lg);
}

.tag-search {
  width: 100%;
  padding: 8px;
  border: none;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.tag-option {
  padding: 8px 12px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
}

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

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

.selected-tag .remove-tag {
  margin-left: 5px;
  cursor: pointer;
  font-weight: bold;
}

/* Star Rating Components */
.star-rating-selector {
  display: flex;
  align-items: center;
  gap: 5px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  /* Removed color transition for performance */
}

.star-btn:hover,
.star-btn.active {
  color: var(--star-color);
}

.clear-rating-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 10px;
  color: var(--text-primary);
}

.tag-more-info {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

/* Advanced Search Toggle */
.advanced-search-toggle {
  margin: 20px 0;
  text-align: center;
}

.toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.toggle-icon {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.advanced-search-container {
  margin-top: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  padding: 20px;
  animation: slideDown 0.3s ease-out;
}

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

/* Quick Search Button Active States */
.quick-tab.active {
  background: var(--accent-primary, #007bff) !important;
  color: white !important;
  border-color: var(--accent-primary, #007bff) !important;
}

.quick-tab-category.active {
  background: #218838 !important;
  color: white !important;
  border-color: #218838 !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .search-container {
    padding-top: 60px;
  }
  
  .search-row {
    flex-direction: column;
  }
}
