/* Search Results Section Styles */

/* Main Container */
.search-results-section {
  position: relative;
  padding: 80px 0;
  background-color: var(--dark-bg);
  min-height: 60vh;
}

.search-results-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 20%, rgba(45, 85, 255, 0.1), transparent 40%),
              radial-gradient(circle at 70% 60%, rgba(255, 45, 85, 0.08), transparent 30%);
  pointer-events: none;
}

/* Search Results Header */
.search-results-header {
  margin-bottom: 40px;
  position: relative;
}

.search-results-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-light);
  letter-spacing: -0.5px;
}

.search-results-header h2 span {
  color: var(--primary-color);
  position: relative;
  display: inline-block;
}

.search-results-header h2 span::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transform: scaleX(0);
  transform-origin: left;
  animation: expandLine 0.8s forwards 0.3s;
}

@keyframes expandLine {
  to { transform: scaleX(1); }
}

.search-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 1rem;
}

.clear-search-btn {
  background: none;
  border: none;
  color: var(--accent-color);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.clear-search-btn:hover {
  background: rgba(255, 45, 85, 0.1);
  color: var(--accent-color-hover);
}

.clear-search-btn i {
  font-size: 0.8rem;
}

/* Search Results Container */
.search-results-container {
  position: relative;
  min-height: 300px;
}

/* Search Results Grid */
.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

/* Search Result Card */
.search-result-card {
  background: rgba(30, 35, 45, 0.6);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

.search-result-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  border-color: rgba(var(--primary-rgb), 0.3);
}

.search-result-card:nth-child(1) { animation-delay: 0.1s; }
.search-result-card:nth-child(2) { animation-delay: 0.2s; }
.search-result-card:nth-child(3) { animation-delay: 0.3s; }
.search-result-card:nth-child(4) { animation-delay: 0.4s; }
.search-result-card:nth-child(5) { animation-delay: 0.5s; }
.search-result-card:nth-child(6) { animation-delay: 0.6s; }

/* Result Image */
.result-image {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.search-result-card:hover .result-image img {
  transform: scale(1.05);
}

.category-badge-sc {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 2;
}

.category-badge.tech {
  background: linear-gradient(135deg, #3a7bd5, #00d2ff);
}

.category-badge.dev {
  background: linear-gradient(135deg, #f83600, #fe8c00);
}

.category-badge.crypto {
  background: linear-gradient(135deg, #8e2de2, #4a00e0);
}

.category-badge.vr {
  background: linear-gradient(135deg, #11998e, #38ef7d);
}

.category-badge.security {
  background: linear-gradient(135deg, #fc466b, #3f5efb);
}

.category-badge.data {
  background: linear-gradient(135deg, #834d9b, #d04ed6);
}

/* Result Content */
.result-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.search-result-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-light);
  line-height: 1.4;
}

.result-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.result-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.result-meta i {
  font-size: 0.9rem;
  color: var(--primary-color);
}

.result-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 15px;
}

/* Result Highlight */
.result-highlight {
  background: rgba(var(--primary-rgb), 0.1);
  border-left: 3px solid var(--primary-color);
  padding: 10px 15px;
  margin-bottom: 20px;
  border-radius: 0 5px 5px 0;
}

.highlight-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.highlight-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.highlight-text mark {
  background: rgba(var(--accent-rgb), 0.3);
  color: var(--accent-color);
  padding: 0 3px;
  border-radius: 3px;
}

/* Read More Button */
.read-more-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 6px;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  text-decoration: none;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.read-more-btn:hover {
  background: rgba(var(--primary-rgb), 0.2);
  transform: translateY(-2px);
}

.read-more-btn .btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  transition: all 0.3s ease;
}

.read-more-btn:hover .btn-icon {
  transform: translateX(3px);
}

/* No Results State */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 50px 20px;
}

.no-results h3 {
  font-size: 1.8rem;
  color: var(--text-light);
  margin: 20px 0 10px;
}

.no-results p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 500px;
  margin-bottom: 30px;
}

.no-results-suggestions {
  background: rgba(30, 35, 45, 0.6);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
  max-width: 500px;
}

.no-results-suggestions h4 {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
}

.no-results-suggestions h4::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--primary-color);
}

.no-results-suggestions ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.no-results-suggestions li {
  color: var(--text-secondary);
  padding: 8px 0 8px 20px;
  position: relative;
}

.no-results-suggestions li::before {
  content: '•';
  color: var(--primary-color);
  position: absolute;
  left: 0;
  top: 8px;
}

.back-to-blog-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 25px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
}

.back-to-blog-btn:hover {
  background: var(--primary-color-hover);
  transform: translateY(-2px);
}

/* Loading State */
.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.search-loading p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 20px;
}

/* Related Searches */
.related-searches {
  margin-top: 50px;
  margin-bottom: 40px;
}

.related-searches h3 {
  font-size: 1.5rem;
  color: var(--text-light);
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
}

.related-searches h3::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 3px;
}

.related-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.related-tag {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(30, 35, 45, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 30px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.related-tag:hover {
  background: rgba(var(--primary-rgb), 0.15);
  color: var(--primary-color);
  border-color: rgba(var(--primary-rgb), 0.3);
  transform: translateY(-2px);
}

/* Search Pagination */
.search-pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 50px;
}

.pagination-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(30, 35, 45, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.pagination-btn:hover, .pagination-btn.active {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
}

.pagination-btn.next {
  width: auto;
  padding: 0 15px;
}

/* Light Theme Adjustments */
body.light-theme .search-results-section {
  background-color: var(--light-bg);
}

body.light-theme .search-results-section::before {
  background: radial-gradient(circle at 30% 20%, rgba(45, 85, 255, 0.05), transparent 40%),
              radial-gradient(circle at 70% 60%, rgba(255, 45, 85, 0.04), transparent 30%);
}

body.light-theme .search-results-header h2 {
  color: var(--dark-text);
}

body.light-theme .search-stats {
  color: var(--dark-text-muted);
}

body.light-theme .search-result-card {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

body.light-theme .search-result-card h3 {
  color: var(--dark-text);
}

body.light-theme .result-meta {
  color: var(--dark-text-muted);
}

body.light-theme .result-excerpt {
  color: var(--dark-text-secondary);
}

body.light-theme .result-highlight {
  background: rgba(var(--primary-rgb), 0.05);
}

body.light-theme .no-results h3 {
  color: var(--dark-text);
}

body.light-theme .no-results p {
  color: var(--dark-text-secondary);
}

body.light-theme .no-results-suggestions {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .no-results-suggestions h4 {
  color: var(--dark-text);
}

body.light-theme .no-results-suggestions li {
  color: var(--dark-text-secondary);
}

body.light-theme .related-searches h3 {
  color: var(--dark-text);
}

body.light-theme .related-tag {
  background: #f5f7fa;
  border-color: rgba(0, 0, 0, 0.05);
  color: var(--dark-text-secondary);
}

body.light-theme .related-tag:hover {
  background: rgba(var(--primary-rgb), 0.1);
}

body.light-theme .pagination-btn {
  background: #f5f7fa;
  border-color: rgba(0, 0, 0, 0.05);
  color: var(--dark-text-secondary);
}

/* Responsive Styles */
@media (max-width: 1200px) {
  .search-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
  }
}

@media (max-width: 992px) {
  .search-results-section {
    padding: 60px 0;
  }
  
  .search-results-header h2 {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .search-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    gap: 20px;
  }
  
  .search-results-header h2 {
    font-size: 1.8rem;
  }
  
  .search-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .clear-search-btn {
    align-self: flex-start;
  }
  
  .related-search-tags {
    gap: 10px;
  }
  
  .related-tag {
    padding: 6px 14px;
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) {
  .search-results-section {
    padding: 40px 0;
  }
  
  .search-results-header h2 {
    font-size: 1.6rem;
  }
  
  .result-image {
    height: 160px;
  }
  
  .search-result-card h3 {
    font-size: 1.1rem;
  }
  
  .no-results h3 {
    font-size: 1.5rem;
  }
  
  .no-results p {
    font-size: 1rem;
  }
  
  .search-pagination {
    gap: 8px;
  }
  
  .pagination-btn {
    width: 36px;
    height: 36px;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Accessibility Improvements */
.read-more-btn:focus,
.back-to-blog-btn:focus,
.clear-search-btn:focus,
.pagination-btn:focus,
.related-tag:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .search-result-card,
  .read-more-btn,
  .back-to-blog-btn,
  .related-tag,
  .pagination-btn {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  
  .search-result-card {
    opacity: 1;
  }
  
  .search-results-header h2 span::after {
    animation: none !important;
    transform: scaleX(1);
  }
}
