/* /assets/css/search.css - ไฟล์ CSS สำหรับหน้า search.html */

/* Search Page Specific Styles */
.search-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 20px;
}

.search-header {
  text-align: center;
  margin-bottom: 3rem;
}

.search-title {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

[data-theme="dark"] .search-title {
  color: var(--text-light);
}

.search-description {
  font-size: 1.2rem;
  color: #666;
  max-width: 800px;
  margin: 0 auto;
}

[data-theme="dark"] .search-description {
  color: #bdc3c7;
}

/* Search Form */
.search-form {
  background-color: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

[data-theme="dark"] .search-form {
  background-color: #34495e;
}

.search-input-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 400px;
  padding: 1rem 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1.1rem;
  background-color: white;
  color: var(--text-dark);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

[data-theme="dark"] .search-input {
  background-color: #34495e;
  color: var(--text-light);
  border-color: #444;
}

.search-input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.search-btn {
  padding: 1rem 2rem;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.search-btn:hover {
  background-color: #2980b9;
}

/* Filters */
.search-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 10px;
}

[data-theme="dark"] .search-filters {
  background-color: #2c3e50;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

[data-theme="dark"] .filter-label {
  color: var(--text-light);
}

.filter-select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background-color: white;
  color: var(--text-dark);
}

[data-theme="dark"] .filter-select {
  background-color: #34495e;
  color: var(--text-light);
  border-color: #444;
}

.filter-select:focus {
  outline: none;
  border-color: var(--secondary-color);
}

/* Search Results */
.search-results {
  margin-bottom: 2rem;
}

.results-info {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid var(--secondary-color);
}

[data-theme="dark"] .results-info {
  background-color: #2c3e50;
  color: #bdc3c7;
}

.results-count {
  font-weight: 700;
  color: var(--secondary-color);
}

/* Result Items */
.result-items {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.result-item {
  background-color: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 2px solid transparent;
}

[data-theme="dark"] .result-item {
  background-color: #34495e;
}

.result-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.result-item.highlighted {
  border-color: var(--secondary-color);
  background-color: #f0f7ff;
}

[data-theme="dark"] .result-item.highlighted {
  background-color: #1a237e;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--secondary-color);
}

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .result-title {
  color: var(--text-light);
}

.result-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: #666;
}

[data-theme="dark"] .result-meta {
  color: #bdc3c7;
}

.result-chapter,
.result-section,
.result-type {
  padding: 0.3rem 0.8rem;
  background-color: #e3f2fd;
  color: #1976d2;
  border-radius: 20px;
  font-weight: 600;
}

[data-theme="dark"] .result-chapter,
[data-theme="dark"] .result-section,
[data-theme="dark"] .result-type {
  background-color: #1a237e;
  color: #bbdefb;
}

.result-content {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.highlight {
  background-color: #fff9c4;
  padding: 0 0.2rem;
  border-radius: 3px;
  font-weight: 600;
  color: #e74c3c;
}

[data-theme="dark"] .highlight {
  background-color: #3e2723;
  color: #ffab91;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

[data-theme="dark"] .no-results {
  background-color: #34495e;
}

.no-results-icon {
  font-size: 4rem;
  color: #95a5a6;
  margin-bottom: 1rem;
}

.no-results-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

[data-theme="dark"] .no-results-title {
  color: var(--text-light);
}

.no-results-text {
  font-size: 1.1rem;
  color: #666;
}

[data-theme="dark"] .no-results-text {
  color: #bdc3c7;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.page-link {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: white;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
}

[data-theme="dark"] .page-link {
  background-color: #34495e;
  color: var(--text-light);
  border-color: #444;
}

.page-link:hover {
  background-color: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.page-link.active {
  background-color: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

/* Advanced Search */
.advanced-search {
  margin-top: 2rem;
  padding: 2rem;
  background-color: #f8f9fa;
  border-radius: 15px;
  border: 2px dashed var(--border-color);
}

[data-theme="dark"] .advanced-search {
  background-color: #2c3e50;
}

.advanced-search-title {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  cursor: pointer;
}

[data-theme="dark"] .advanced-search-title {
  color: var(--text-light);
}

.advanced-search-content {
  display: none;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border-color);
}

.advanced-search-content.active {
  display: block;
}

.advanced-search-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* Search Statistics */
.search-stats {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #e8f5e8;
  border-radius: 10px;
  border-left: 4px solid #2e7d32;
}

[data-theme="dark"] .search-stats {
  background-color: #1b5e20;
  border-left-color: #4caf50;
}

.search-stats-title {
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2e7d32;
}

[data-theme="dark"] .search-stats-title {
  color: #81c784;
}

.search-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-item {
  background-color: white;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

[data-theme="dark"] .stat-item {
  background-color: #2e7d32;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
}

[data-theme="dark"] .stat-label {
  color: #bdc3c7;
}

/* Responsive Design */
@media (max-width: 768px) {
  .search-input-group {
    flex-direction: column;
  }
  
  .search-input {
    min-width: 100%;
  }
  
  .search-filters {
    flex-direction: column;
  }
  
  .filter-group {
    min-width: 100%;
  }
  
  .advanced-search-row {
    flex-direction: column;
  }
  
  .pagination {
    gap: 0.3rem;
  }
  
  .page-link {
    width: 35px;
    height: 35px;
    line-height: 35px;
    font-size: 0.9rem;
  }
}