/**
 * MetaBull Wiki Search Filter & Sorting Styles
 */

/* Anti-flicker: Instantly hide stock native subheader, list items & pagination.
   Scoped under body.wsf-active (set by wiki-search-filter.js on load) so native
   search still works if the JS asset fails to load or throws. */
body.wsf-active .search-results-container > .v-subheader,
body.wsf-active .search-results-container > .search-results-items,
body.wsf-active .search-results > .search-results-container > .v-subheader,
body.wsf-active .search-results > .search-results-container > .search-results-items,
body.wsf-active .search-results-container > .v-list,
body.wsf-active .search-results > .search-results-container > .v-list,
body.wsf-active .search-results-container .v-pagination,
body.wsf-active .search-results-container ul.v-pagination,
body.wsf-active .search-results .v-pagination,
body.wsf-active .v-dialog .v-pagination {
  display: none !important;
}

/* Modal Header & Top-Right Close Button */
.wsf-modal-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.wsf-modal-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #e11d48;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wsf-modal-close-btn:hover {
  background-color: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.wsf-modal-close-btn svg {
  width: 15px;
  height: 15px;
}

/* Main Container */
.wsf-search-container,
.wsf-modal-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1f2937;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 16px;
}

/* Modal Specific Sizing */
.v-dialog .wsf-modal-container,
.v-menu__content .wsf-modal-container,
.v-overlay .wsf-modal-container,
.search-results-container .wsf-modal-container {
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Main Body Grid: Left Filter Sidebar + Right Results */
.wsf-search-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .wsf-search-body {
    grid-template-columns: 1fr;
  }
}

/* Left Filter Panel */
.wsf-filter-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.wsf-filter-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 14px 0;
}

.wsf-filter-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.wsf-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: #1f2937;
  font-weight: 500;
}

.wsf-filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.wsf-filter-checkbox {
  width: 17px;
  height: 17px;
  accent-color: #2563eb;
  border-radius: 4px;
  cursor: pointer;
}

.wsf-filter-count {
  font-size: 13px;
  color: #6b7280;
  font-weight: 400;
}

.wsf-divider {
  height: 1px;
  background-color: #f3f4f6;
  margin: 16px 0;
  border: none;
}

/* Sort dropdown control */
.wsf-sort-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background-color: #ffffff;
  font-size: 14px;
  color: #1f2937;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.wsf-sort-select:focus,
.wsf-sort-select:hover {
  border-color: #2563eb;
}

/* Right Results List */
.wsf-results-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Empty results state */
.wsf-empty-state {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 40px 24px;
  text-align: center;
  color: #6b7280;
}

.wsf-empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 8px 0;
}

.wsf-empty-state p {
  font-size: 14px;
  margin: 0;
}

/* Individual Search Result Card */
.wsf-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 5px 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wsf-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

.wsf-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.wsf-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wsf-card-title {
  font-size: 17px;
  font-weight: 600;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}

.wsf-card:hover .wsf-card-title {
  color: #2563eb;
}

/* Type Badges */
.wsf-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.wsf-badge-epic {
  background-color: #dbeafe;
  color: #1e40af;
}

.wsf-badge-technical-wiki {
  background-color: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.wsf-badge-felix-user-manual {
  background-color: #dcfce7;
  color: #166534;
}

.wsf-badge-sprint {
  background-color: #fef3c7;
  color: #92400e;
}

.wsf-badge-release-notes {
  background-color: #f3e8ff;
  color: #6b21a8;
}

.wsf-badge-other {
  background-color: #e0f2fe;
  color: #0369a1;
}

/* Date display on card header */
.wsf-card-date {
  font-size: 13px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.wsf-card-date svg {
  width: 14px;
  height: 14px;
  color: #9ca3af;
}

/* Path subtitle */
.wsf-card-path {
  font-size: 13px;
  color: #6b7280;
  margin: 0 !important;
  word-break: break-all;
  text-align: left;
}

/* Pagination Bar */
.wsf-pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.wsf-pagination-info {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.wsf-pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wsf-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.wsf-pagination-btn:hover:not(:disabled):not(.active) {
  border-color: #2563eb;
  color: #2563eb;
  background-color: #f0f7ff;
}

.wsf-pagination-btn.active {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  font-weight: 600;
}

.wsf-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #e5e7eb;
  color: #9ca3af;
}

.wsf-pagination-ellipsis {
  padding: 0 4px;
  color: #9ca3af;
  font-size: 14px;
  user-select: none;
}
