/*
 * 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.
 */

/* Root Variables for Theme Support - Default to Dark */
:root {
  --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);
}

[data-theme="light"] {
  --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);
}

/* 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;
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.5;
}

html {
  background-color: var(--bg-primary) !important;
  transition: background-color 0.3s ease;
}

/* Theme Toggle Component */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.theme-btn {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.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;
}

.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;
  transition: color 0.2s;
}

.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);
}

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