/* File: css/voltwiki.css - VoltWiki specific styling */

/* ========== WIKI NAVIGATION ========== */
.wiki-nav {
  font-size: 0.875rem;
}

.wiki-link {
  color: #cbd5e0;
  text-decoration: none;
  padding: 2px 0;
  display: block;
  transition: color 0.2s ease;
  font-size: 0.8rem;
}

.wiki-link:hover {
  color: #63b3ed;
  text-decoration: none;
}

.wiki-link.active {
  color: #4299e1;
  font-weight: 600;
}

.wiki-category {
  border-bottom: 1px solid #374151;
  padding-bottom: 0.75rem;
}

.wiki-category:last-child {
  border-bottom: none;
}

/* ========== WIKI CONTENT ========== */
.wiki-content {
  color: #e2e8f0;
  line-height: 1.6;
}

.wiki-article {
  background: #1f2937;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  border-left: 4px solid #4299e1;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.wiki-article h2 {
  color: #63b3ed;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.wiki-article h2 i {
  margin-right: 0.5rem;
  color: #4299e1;
}

.wiki-article h3 {
  color: #9ca3af;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wiki-article p {
  margin-bottom: 1rem;
  color: #cbd5e0;
}

.wiki-article ul, .wiki-article ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.wiki-article li {
  margin-bottom: 0.5rem;
  color: #cbd5e0;
}

.wiki-article strong {
  color: #f7fafc;
  font-weight: 600;
}

/* ========== WIKI MEDIA ========== */
.wiki-media {
  margin: 1.5rem 0;
}

.wiki-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 0.5rem;
}

.wiki-video {
  width: 100%;
  max-width: 560px;
  height: 315px;
  border-radius: 8px;
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.wiki-media-caption {
  font-size: 0.875rem;
  color: #9ca3af;
  text-align: center;
  font-style: italic;
  margin-top: 0.5rem;
}

/* ========== WIKI INFO BOXES ========== */
.wiki-info-box {
  background: #065f46;
  border: 1px solid #059669;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  position: relative;
}

.wiki-info-box::before {
  content: "\f05a";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #10b981;
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.wiki-info-box-content {
  padding-left: 2rem;
  color: #d1fae5;
}

.wiki-warning-box {
  background: #92400e;
  border: 1px solid #d97706;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  position: relative;
}

.wiki-warning-box::before {
  content: "\f071";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #f59e0b;
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.wiki-warning-box-content {
  padding-left: 2rem;
  color: #fed7aa;
}

/* ========== WIKI TECHNICAL SPECS ========== */
.wiki-specs-table {
  width: 100%;
  background: #374151;
  border-radius: 8px;
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.wiki-specs-table th,
.wiki-specs-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #4b5563;
}

.wiki-specs-table th {
  background: #4b5563;
  color: #f3f4f6;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

.wiki-specs-table td {
  color: #cbd5e0;
}

.wiki-specs-table tr:last-child td {
  border-bottom: none;
}

.wiki-specs-table tr:hover {
  background: #4b5563;
}

/* ========== WIKI TAGS ========== */
.wiki-tags {
  margin: 1.5rem 0;
}

.wiki-tag {
  display: inline-block;
  background: #1e40af;
  color: #dbeafe;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.wiki-tag:hover {
  background: #2563eb;
  color: #dbeafe;
  text-decoration: none;
}

/* ========== RELATED ARTICLES ========== */
.related-article-card {
  background: #1f2937;
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid #374151;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.related-article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: inherit;
}

.related-article-title {
  color: #63b3ed;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.related-article-excerpt {
  color: #9ca3af;
  font-size: 0.875rem;
  line-height: 1.4;
}

/* ========== WIKI BREADCRUMBS ========== */
.wiki-breadcrumbs {
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

.wiki-breadcrumbs a {
  color: #9ca3af;
  text-decoration: none;
}

.wiki-breadcrumbs a:hover {
  color: #63b3ed;
}

.wiki-breadcrumbs .separator {
  margin: 0 0.5rem;
  color: #6b7280;
}

.wiki-breadcrumbs .current {
  color: #e2e8f0;
  font-weight: 500;
}

/* ========== WIKI SEARCH HIGHLIGHTS ========== */
.wiki-search-highlight {
  background: #fbbf24;
  color: #92400e;
  padding: 1px 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* ========== WIKI SEARCH STYLES ========== */
.wiki-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.search-results-visible {
  display: block !important;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #374151;
  background: #374151;
}

.search-results-count {
  color: #9ca3af;
  font-size: 0.875rem;
  flex: 1;
}

.search-close-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.search-close-btn:hover {
  background: #4b5563;
  color: #f3f4f6;
}

.search-results-list {
  max-height: 320px;
  overflow-y: auto;
}

.search-result-item {
  padding: 1rem;
  border-bottom: 1px solid #374151;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-result-item:hover,
.search-result-highlighted {
  background: #374151;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.search-result-title {
  color: #63b3ed;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.search-result-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  margin-left: 1rem;
}

.search-result-category {
  color: #9ca3af;
  font-size: 0.75rem;
  background: #4b5563;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
}

.search-result-score {
  color: #6b7280;
  font-size: 0.625rem;
}

.search-result-snippet {
  color: #cbd5e0;
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.search-result-snippet mark {
  background: #fbbf24;
  color: #92400e;
  padding: 1px 2px;
  border-radius: 2px;
}

.search-result-tags {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.search-result-tags .wiki-tag {
  font-size: 0.625rem;
  padding: 0.125rem 0.5rem;
}

/* ========== SEARCH NO RESULTS ========== */
.search-no-results {
  padding: 2rem;
  text-align: center;
  color: #9ca3af;
}

.search-suggestions ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.search-suggestions li {
  margin-bottom: 0.25rem;
}

/* ========== SEARCH HISTORY ========== */
.search-history {
  padding: 0.5rem 0;
}

.search-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #374151;
}

.search-clear-history {
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.search-history-list {
  max-height: 200px;
  overflow-y: auto;
}

.search-history-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  color: #cbd5e0;
}

.search-history-item:hover {
  background: #374151;
}

.search-history-item span {
  flex: 1;
  margin-left: 0.5rem;
}

.search-history-remove {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s;
}

.search-history-item:hover .search-history-remove {
  opacity: 1;
}

.search-history-remove:hover {
  background: #4b5563;
  color: #f87171;
}

/* ========== CATEGORY CARDS (Homepage) ========== */
.category-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .wiki-article {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .wiki-article h2 {
    font-size: 1.5rem;
  }
  
  .wiki-video {
    height: 200px;
  }
  
  .wiki-specs-table th,
  .wiki-specs-table td {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
  
  .wiki-search-results {
    position: fixed;
    top: 80px;
    left: 1rem;
    right: 1rem;
    max-height: calc(100vh - 100px);
    z-index: 1001;
  }

  .search-result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-result-meta {
    flex-direction: row;
    align-items: center;
    margin-left: 0;
    margin-top: 0.25rem;
  }

  .search-result-title {
    font-size: 0.875rem;
  }

  .search-result-snippet {
    font-size: 0.8rem;
  }

  .search-result-tags .wiki-tag {
    font-size: 0.6rem;
  }
}

@media (max-width: 640px) {
  .wiki-article h2 {
    font-size: 1.25rem;
  }
  
  .wiki-info-box-content,
  .wiki-warning-box-content {
    padding-left: 1rem;
  }
  
  .wiki-info-box::before,
  .wiki-warning-box::before {
    display: none;
  }
  
  .wiki-specs-table {
    font-size: 0.8rem;
  }
  
  .wiki-specs-table th,
  .wiki-specs-table td {
    padding: 0.4rem 0.5rem;
  }
}

/* ========== LOADING STATES ========== */
.wiki-loading {
  text-align: center;
  padding: 3rem;
  color: #9ca3af;
}

.wiki-loading i {
  font-size: 2rem;
  margin-bottom: 1rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========== ADMIN EDIT BUTTONS (for admin interface) ========== */
.wiki-admin-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.wiki-article:hover .wiki-admin-controls {
  opacity: 1;
}

.wiki-edit-btn,
.wiki-delete-btn {
  background: #374151;
  color: #9ca3af;
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
  margin-left: 0.25rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.wiki-edit-btn:hover {
  background: #1e40af;
  color: #dbeafe;
}

.wiki-delete-btn:hover {
  background: #dc2626;
  color: #fee2e2;
}

/* ========== SCROLLBAR STYLES FOR SEARCH ========== */
.search-results-list::-webkit-scrollbar,
.search-history-list::-webkit-scrollbar {
  width: 6px;
}

.search-results-list::-webkit-scrollbar-track,
.search-history-list::-webkit-scrollbar-track {
  background: #1f2937;
}

.search-results-list::-webkit-scrollbar-thumb,
.search-history-list::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 3px;
}

.search-results-list::-webkit-scrollbar-thumb:hover,
.search-history-list::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* ========== SEARCH LOADING STATE ========== */
.search-loading {
  padding: 2rem;
  text-align: center;
  color: #9ca3af;
}

.search-loading i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  animation: spin 1s linear infinite;
}

/* ========== SEARCH KEYBOARD NAVIGATION ========== */
.search-result-highlighted {
  background: #3b82f6 !important;
  color: #ffffff;
}

.search-result-highlighted .search-result-title {
  color: #ffffff;
}

.search-result-highlighted .search-result-snippet {
  color: #e5e7eb;
}

.search-result-highlighted .search-result-category {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* ========== PRINT STYLES ========== */
@media print {
  .filters, .banner-slot, .wiki-admin-controls, #compareTray, .wiki-search-results {
    display: none !important;
  }
  
  .wiki-article {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .wiki-content {
    color: #000;
  }
  
  .wiki-article h2,
  .wiki-article h3,
  .wiki-article p,
  .wiki-article li {
    color: #000;
  }
}

/* ========== WIKI NAVIGATION ========== */
.wiki-nav {
  font-size: 0.875rem;
}

.wiki-link {
  color: #cbd5e0;
  text-decoration: none;
  padding: 2px 0;
  display: block;
  transition: color 0.2s ease;
  font-size: 0.8rem;
}

.wiki-link:hover {
  color: #63b3ed;
  text-decoration: none;
}

.wiki-link.active {
  color: #4299e1;
  font-weight: 600;
}

.wiki-category {
  border-bottom: 1px solid #374151;
  padding-bottom: 0.75rem;
}

.wiki-category:last-child {
  border-bottom: none;
}

/* ========== WIKI CONTENT ========== */
.wiki-content {
  color: #e2e8f0;
  line-height: 1.6;
}

.wiki-article {
  background: #1f2937;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  border-left: 4px solid #4299e1;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.wiki-article h2 {
  color: #63b3ed;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.wiki-article h2 i {
  margin-right: 0.5rem;
  color: #4299e1;
}

.wiki-article h3 {
  color: #9ca3af;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wiki-article p {
  margin-bottom: 1rem;
  color: #cbd5e0;
}

.wiki-article ul, .wiki-article ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.wiki-article li {
  margin-bottom: 0.5rem;
  color: #cbd5e0;
}

.wiki-article strong {
  color: #f7fafc;
  font-weight: 600;
}

/* ========== WIKI MEDIA ========== */
.wiki-media {
  margin: 1.5rem 0;
}

.wiki-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 0.5rem;
}

.wiki-video {
  width: 100%;
  max-width: 560px;
  height: 315px;
  border-radius: 8px;
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.wiki-media-caption {
  font-size: 0.875rem;
  color: #9ca3af;
  text-align: center;
  font-style: italic;
  margin-top: 0.5rem;
}

/* ========== WIKI INFO BOXES ========== */
.wiki-info-box {
  background: #065f46;
  border: 1px solid #059669;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  position: relative;
}

.wiki-info-box::before {
  content: "\f05a";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #10b981;
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.wiki-info-box-content {
  padding-left: 2rem;
  color: #d1fae5;
}

.wiki-warning-box {
  background: #92400e;
  border: 1px solid #d97706;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  position: relative;
}

.wiki-warning-box::before {
  content: "\f071";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #f59e0b;
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.wiki-warning-box-content {
  padding-left: 2rem;
  color: #fed7aa;
}

/* ========== WIKI TECHNICAL SPECS ========== */
.wiki-specs-table {
  width: 100%;
  background: #374151;
  border-radius: 8px;
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.wiki-specs-table th,
.wiki-specs-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #4b5563;
}

.wiki-specs-table th {
  background: #4b5563;
  color: #f3f4f6;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

.wiki-specs-table td {
  color: #cbd5e0;
}

.wiki-specs-table tr:last-child td {
  border-bottom: none;
}

.wiki-specs-table tr:hover {
  background: #4b5563;
}

/* ========== WIKI TAGS ========== */
.wiki-tags {
  margin: 1.5rem 0;
}

.wiki-tag {
  display: inline-block;
  background: #1e40af;
  color: #dbeafe;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.wiki-tag:hover {
  background: #2563eb;
  color: #dbeafe;
  text-decoration: none;
}

/* ========== RELATED ARTICLES ========== */
.related-article-card {
  background: #1f2937;
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid #374151;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.related-article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: inherit;
}

.related-article-title {
  color: #63b3ed;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.related-article-excerpt {
  color: #9ca3af;
  font-size: 0.875rem;
  line-height: 1.4;
}

/* ========== WIKI BREADCRUMBS ========== */
.wiki-breadcrumbs {
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

.wiki-breadcrumbs a {
  color: #9ca3af;
  text-decoration: none;
}

.wiki-breadcrumbs a:hover {
  color: #63b3ed;
}

.wiki-breadcrumbs .separator {
  margin: 0 0.5rem;
  color: #6b7280;
}

.wiki-breadcrumbs .current {
  color: #e2e8f0;
  font-weight: 500;
}

/* ========== WIKI SEARCH HIGHLIGHTS ========== */
.wiki-search-highlight {
  background: #fbbf24;
  color: #92400e;
  padding: 1px 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .wiki-article {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .wiki-article h2 {
    font-size: 1.5rem;
  }
  
  .wiki-video {
    height: 200px;
  }
  
  .wiki-specs-table th,
  .wiki-specs-table td {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 640px) {
  .wiki-article h2 {
    font-size: 1.25rem;
  }
  
  .wiki-info-box-content,
  .wiki-warning-box-content {
    padding-left: 1rem;
  }
  
  .wiki-info-box::before,
  .wiki-warning-box::before {
    display: none;
  }
  
  .wiki-specs-table {
    font-size: 0.8rem;
  }
  
  .wiki-specs-table th,
  .wiki-specs-table td {
    padding: 0.4rem 0.5rem;
  }
}

/* ========== LOADING STATES ========== */
.wiki-loading {
  text-align: center;
  padding: 3rem;
  color: #9ca3af;
}

.wiki-loading i {
  font-size: 2rem;
  margin-bottom: 1rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========== ADMIN EDIT BUTTONS (for admin interface) ========== */
.wiki-admin-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.wiki-article:hover .wiki-admin-controls {
  opacity: 1;
}

.wiki-edit-btn,
.wiki-delete-btn {
  background: #374151;
  color: #9ca3af;
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
  margin-left: 0.25rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.wiki-edit-btn:hover {
  background: #1e40af;
  color: #dbeafe;
}

.wiki-delete-btn:hover {
  background: #dc2626;
  color: #fee2e2;
}

/* ========== WIKI SEARCH STYLES ========== */
.wiki-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.search-results-visible {
  display: block !important;
}

.search-results-header {
  display: flex;
  justify-content: between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #374151;
  background: #374151;
}

.search-results-count {
  color: #9ca3af;
  font-size: 0.875rem;
  flex: 1;
}

.search-close-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.search-close-btn:hover {
  background: #4b5563;
  color: #f3f4f6;
}

.search-results-list {
  max-height: 320px;
  overflow-y: auto;
}

.search-result-item {
  padding: 1rem;
  border-bottom: 1px solid #374151;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-result-item:hover,
.search-result-highlighted {
  background: #374151;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-header {
  display: flex;
  justify-content: between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.search-result-title {
  color: #63b3ed;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.search-result-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  margin-left: 1rem;
}

.search-result-category {
  color: #9ca3af;
  font-size: 0.75rem;
  background: #4b5563;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
}

.search-result-score {
  color: #6b7280;
  font-size: 0.625rem;
}

.search-result-snippet {
  color: #cbd5e0;
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.search-result-snippet mark {
  background: #fbbf24;
  color: #92400e;
  padding: 1px 2px;
  border-radius: 2px;
}

.search-result-tags {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.search-result-tags .wiki-tag {
  font-size: 0.625rem;
  padding: 0.125rem 0.5rem;
}

/* ========== SEARCH NO RESULTS ========== */
.search-no-results {
  padding: 2rem;
  text-align: center;
  color: #9ca3af;
}

.search-suggestions ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.search-suggestions li {
  margin-bottom: 0.25rem;
}

/* ========== SEARCH HISTORY ========== */
.search-history {
  padding: 0.5rem 0;
}

.search-history-header {
  display: flex;
  justify-content: between;
  align-items: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #374151;
}

.search-clear-history {
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.search-history-list {
  max-height: 200px;
  overflow-y: auto;
}

.search-history-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  color: #cbd5e0;
}

.search-history-item:hover {
  background: #374151;
}

.search-history-item span {
  flex: 1;
  margin-left: 0.5rem;
}

.search-history-remove {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s;
}

.search-history-item:hover .search-history-remove {
  opacity: 1;
}

.search-history-remove:hover {
  background: #4b5563;
  color: #f87171;
}

/* ========== CATEGORY CARDS (Homepage) ========== */
.category-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ========== MOBILE SEARCH STYLES ========== */
@media (max-width: 768px) {
  .wiki-search-results {
    position: fixed;
    top: 80px;
    left: 1rem;
    right: 1rem;
    max-height: calc(100vh - 100px);
    z-index: 1001;
  }

  .search-result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-result-meta {
    flex-direction: row;
    align-items: center;
    margin-left: 0;
    margin-top: 0.25rem;
  }

  .search-result-title {
    font-size: 0.875rem;
  }

  .search-result-snippet {
    font-size: 0.8rem;
  }

  .search-result-tags .wiki-tag {
    font-size: 0.6rem;
  }
}

/* ========== SEARCH INPUT ENHANCEMENTS ========== */
#wikiSearch {
  position: relative;
}

#wikiSearch:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ========== SCROLLBAR STYLES FOR SEARCH ========== */
.search-results-list::-webkit-scrollbar,
.search-history-list::-webkit-scrollbar {
  width: 6px;
}

.search-results-list::-webkit-scrollbar-track,
.search-history-list::-webkit-scrollbar-track {
  background: #1f2937;
}

.search-results-list::-webkit-scrollbar-thumb,
.search-history-list::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 3px;
}

.search-results-list::-webkit-scrollbar-thumb:hover,
.search-history-list::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* ========== SEARCH LOADING STATE ========== */
.search-loading {
  padding: 2rem;
  text-align: center;
  color: #9ca3af;
}

.search-loading i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  animation: spin 1s linear infinite;
}

/* ========== SEARCH KEYBOARD NAVIGATION ========== */
.search-result-highlighted {
  background: #3b82f6 !important;
  color: #ffffff;
}

.search-result-highlighted .search-result-title {
  color: #ffffff;
}

.search-result-highlighted .search-result-snippet {
  color: #e5e7eb;
}

.search-result-highlighted .search-result-category {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* ========== PRINT STYLES ========== */
@media print {
  .filters, .banner-slot, .wiki-admin-controls, #compareTray, .wiki-search-results {
    display: none !important;
  }
  
  .wiki-article {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .wiki-content {
    color: #000;
  }
  
  .wiki-article h2,
  .wiki-article h3,
  .wiki-article p,
  .wiki-article li {
    color: #000;
  }
}
/* Sticky wiki sidebar (desktop) */
@media (min-width: 1024px) {
  #filtersPanel {
    position: sticky;
    top: 88px;                /* align with header height */
    height: calc(100vh - 100px);
    overflow: auto;
    align-self: flex-start;
  }
}

/* Ensure related articles never tuck under fixed elements */
.related-articles {
  position: relative;
  z-index: 1;
}

/* Extra bottom padding for mobile so sticky ads/tray don’t overlap content */
@media (max-width: 768px) {
  main { padding-bottom: 70px; }
}
/* Search Results Styling */
.wiki-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #374151;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  display: block;
  padding: 0.75rem;
  border-bottom: 1px solid #4B5563;
  color: #E5E7EB;
  text-decoration: none;
  transition: background-color 0.2s;
}

.search-result-item:hover {
  background-color: #4B5563;
}

.search-result-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.search-result-excerpt {
  font-size: 0.875rem;
  color: #9CA3AF;
  margin-bottom: 0.25rem;
}

.search-result-breadcrumb {
  font-size: 0.75rem;
  color: #6B7280;
}