/**
 * DM Search — Styles
 * CallCentersForHire.com | Data Monster, Inc. | July 2026
 * Dark theme pass — September 2026
 *
 * Brand colors:
 *   Primary blue:  #00aff0
 *   Page bg:       #02070f
 *   Panel surface: #0a1827
 *   Text (light):  #f2f9ff
 *   Charcoal gray: #32373c (legacy — no longer used for surfaces)
 *
 * Covers:
 *   1. Sitewide nav search typeahead dropdown (.dm-nav-dropdown)
 *   2. Marketplace search panel (.dm-search-panel)
 *   3. Marketplace filter panel (.dm-filter-panel)
 *   4. Results grid (.dm-results-grid) with even-row enforcement
 *   5. Pagination (.dm-pagination)
 *   6. Product cards (.dm-result-card)
 *   7. Active filter chips (.dm-active-filters)
 *   8. Loading state + spinner
 *
 * All button text uses element+class+!important per site standing rule
 * to beat .wrap a{color:#00aff0} global specificity.
 *
 * Breakpoints:
 *   Tablet: max-width: 900px
 *   Mobile: max-width: 540px
 */


/* ═══════════════════════════════════════════════════════════════
   1. TYPEAHEAD DROPDOWN — shared by nav + marketplace search
   ═══════════════════════════════════════════════════════════════ */

/* Container — absolutely positioned below the search input */
.dm-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #0a1827;
  border: 1px solid rgba(255,255,255,0.12);
  border-top: 2px solid #00aff0;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45), 0 0 16px rgba(0,175,240,0.12);
  z-index: 99999;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}
.dm-search-dropdown[hidden] { display: none; }

/* Each suggestion link */
a.dm-suggestion-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  text-decoration: none !important;
  color: #f2f9ff !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  transition: background 0.15s, box-shadow 0.15s !important;
  font-family: 'Segoe UI', Arial, sans-serif !important;
}
a.dm-suggestion-item:last-of-type { border-bottom: none !important; }
a.dm-suggestion-item:hover,
a.dm-suggestion-item.dm-suggestion-active {
  background: rgba(0,175,240,0.12) !important;
  color: #f2f9ff !important;
  box-shadow: inset 0 0 0 1px rgba(0,175,240,0.35), 0 0 16px rgba(0,175,240,0.28) !important;
}

/* Left side: title + category */
.dm-sug-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.dm-sug-title {
  font-size: 13px;
  font-weight: 600;
  color: #f2f9ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-sug-cat {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

/* Right side: badges + price */
.dm-sug-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.dm-sug-price {
  font-size: 13px;
  font-weight: 700;
  color: #00aff0;
}

/* Inline badges inside typeahead */
.dm-sug-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  white-space: nowrap;
}
.dm-sug-badge-verified { background: rgba(0,175,240,0.16); color: #6fd3ff; }
.dm-sug-badge-featured { background: rgba(255,193,7,0.16); color: #ffd166; }
.dm-sug-badge-loc      { background: rgba(167,139,250,0.16); color: #c4b5fd; }

/* Highlight matched text */
mark.dm-sug-match {
  background: rgba(0,175,240,0.35);
  color: #f2f9ff;
  border-radius: 2px;
  padding: 0 1px;
  font-style: normal;
}

/* Empty state message */
.dm-suggestion-empty {
  padding: 14px 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-family: 'Segoe UI', Arial, sans-serif;
}

/* "View all results" link at bottom of dropdown */
a.dm-suggestion-viewall {
  display: block !important;
  padding: 10px 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #00aff0 !important;
  text-decoration: none !important;
  background: rgba(255,255,255,0.04) !important;
  border-top: 1px solid rgba(255,255,255,0.1) !important;
  text-align: center !important;
  transition: background 0.15s, box-shadow 0.15s !important;
}
a.dm-suggestion-viewall:hover {
  background: rgba(0,175,240,0.14) !important;
  box-shadow: 0 0 16px rgba(0,175,240,0.28) !important;
}

/* ═══════════════════════════════════════════════════════════════
   2. MARKETPLACE SEARCH PANEL
   ═══════════════════════════════════════════════════════════════ */

.dm-search-panel {
  background: linear-gradient(135deg, #0d1530 0%, #0a1628 100%);
  border-radius: 12px;
  padding: 20px 24px 0;
  margin-bottom: 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

.dm-search-bar-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 20px;
}

.dm-search-input-wrap {
  flex: 1;
  position: relative;
}

.dm-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: none;
  stroke: rgba(255,255,255,0.4);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.dm-market-search-input {
  width: 100%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 11px 14px 11px 38px;
  font-size: 14px;
  color: #fff;
  font-family: 'Segoe UI', Arial, sans-serif;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.dm-market-search-input::placeholder { color: rgba(255,255,255,0.4); }
.dm-market-search-input:focus {
  border-color: #00aff0;
  background: rgba(0,175,240,0.08);
  box-shadow: 0 0 16px rgba(0,175,240,0.22);
}

#dm-market-dropdown {
  border-radius: 0 0 10px 10px;
}

button.dm-search-btn {
  background: #00aff0 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 11px 22px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  font-family: 'Segoe UI', Arial, sans-serif !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: background 0.15s, box-shadow 0.15s !important;
}
button.dm-search-btn:hover {
  background: #009fd8 !important;
  box-shadow: 0 0 16px rgba(0,175,240,0.4) !important;
}

button.dm-filter-toggle-btn {
  background: rgba(255,255,255,0.08) !important;
  color: rgba(255,255,255,0.8) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 8px !important;
  padding: 10px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: 'Segoe UI', Arial, sans-serif !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  transition: all 0.15s !important;
}
button.dm-filter-toggle-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
button.dm-filter-toggle-btn:hover,
button.dm-filter-toggle-btn[aria-expanded="true"] {
  background: rgba(0,175,240,0.2) !important;
  border-color: #00aff0 !important;
  color: #00aff0 !important;
  box-shadow: 0 0 16px rgba(0,175,240,0.28) !important;
}

/* ═══════════════════════════════════════════════════════════════
   3. FILTER PANEL
   ═══════════════════════════════════════════════════════════════ */

.dm-filter-panel {
  border-top: 1px solid rgba(255,255,255,0.08);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.dm-filter-panel.dm-filter-open { max-height: 400px; }

@media (min-width: 901px) {
  .dm-filter-panel {
    max-height: none !important;
    overflow: visible !important;
  }
  button.dm-filter-toggle-btn { display: none !important; }
}

.dm-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto auto;
  gap: 12px;
  align-items: end;
  padding: 16px 0 20px;
}

.dm-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dm-filter-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(255,255,255,0.5);
  font-family: 'Segoe UI', Arial, sans-serif;
}

.dm-select-wrap {
  position: relative;
}
.dm-select-wrap::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(255,255,255,0.4);
  border-bottom: 2px solid rgba(255,255,255,0.4);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.dm-filter-select {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 7px;
  color: #fff;
  font-size: 13px;
  font-family: 'Segoe UI', Arial, sans-serif;
  padding: 9px 30px 9px 12px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dm-filter-select:focus {
  border-color: #00aff0;
  box-shadow: 0 0 16px rgba(0,175,240,0.22);
}
.dm-filter-select option { background: #0d1530; color: #fff; }

.dm-filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.dm-filter-chip { cursor: pointer; }
.dm-filter-chip-input { position: absolute; opacity: 0; width: 0; height: 0; }

.dm-chip-inner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  font-family: 'Segoe UI', Arial, sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
}
.dm-chip-inner svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.dm-filter-chip-input:checked + .dm-chip-inner {
  background: #00aff0;
  border-color: #00aff0;
  color: #fff;
  box-shadow: 0 0 16px rgba(0,175,240,0.4);
}
.dm-chip-inner:hover {
  border-color: #00aff0;
  color: #00aff0;
  box-shadow: 0 0 16px rgba(0,175,240,0.22);
}

button.dm-clear-btn {
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 7px !important;
  color: rgba(255,255,255,0.5) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 9px 14px !important;
  cursor: pointer !important;
  font-family: 'Segoe UI', Arial, sans-serif !important;
  transition: all 0.15s !important;
  white-space: nowrap !important;
}
button.dm-clear-btn:hover {
  border-color: rgba(255,255,255,0.35) !important;
  color: rgba(255,255,255,0.8) !important;
}

/* ═══════════════════════════════════════════════════════════════
   4. ACTIVE FILTER CHIPS
   ═══════════════════════════════════════════════════════════════ */

.dm-active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0 16px;
}
.dm-active-filters[hidden] { display: none; }

.dm-active-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-family: 'Segoe UI', Arial, sans-serif;
}

button.dm-active-chip {
  background: rgba(0,175,240,0.15) !important;
  border: 1px solid #00aff0 !important;
  border-radius: 20px !important;
  color: #00aff0 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 3px 10px !important;
  cursor: pointer !important;
  font-family: 'Segoe UI', Arial, sans-serif !important;
  transition: all 0.15s !important;
}
button.dm-active-chip:hover {
  background: #00aff0 !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(0,175,240,0.4) !important;
}

/* ═══════════════════════════════════════════════════════════════
   5. RESULTS META (count row)
   ═══════════════════════════════════════════════════════════════ */

.dm-results-wrap { margin-top: 4px; }

.dm-results-meta {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  font-family: 'Segoe UI', Arial, sans-serif;
  font-weight: 500;
  margin-bottom: 16px;
  min-height: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   6. RESULTS GRID + PRODUCT CARDS
   ═══════════════════════════════════════════════════════════════ */

.dm-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  transition: opacity 0.2s;
}

.dm-result-spacer {
  visibility: hidden;
  pointer-events: none;
}

.dm-result-card {
  background: #0a1827;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: box-shadow 0.18s, transform 0.18s;
  height: 100%;
}
.dm-result-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.55), 0 0 16px rgba(0,175,240,0.28);
  transform: translateY(-2px);
}

.dm-card-header {
  background: linear-gradient(135deg, #0d1530 0%, #0a1628 100%);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
}
.dm-card-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #00aff0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.dm-card-featured-tag {
  background: #00aff0;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.dm-card-body {
  padding: 16px 16px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.dm-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #f2f9ff;
  margin: 0 0 8px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: 'Segoe UI', Arial, sans-serif;
}
.dm-card-title a {
  color: #f2f9ff !important;
  text-decoration: none !important;
}
.dm-card-title a:hover { color: #00aff0 !important; }

.dm-card-excerpt {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  margin: 0 0 12px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dm-card-price {
  font-size: 16px;
  font-weight: 800;
  color: #00aff0;
  margin: 0 0 12px;
  font-family: 'Segoe UI', Arial, sans-serif;
}

.dm-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}
.dm-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}
.dm-card-badge svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.dm-badge-verified { background: rgba(0,175,240,0.16); color: #6fd3ff; }
.dm-badge-featured { background: rgba(255,193,7,0.16); color: #ffd166; }
.dm-badge-loc       { background: rgba(167,139,250,0.16); color: #c4b5fd; }

.dm-card-footer { padding: 0 16px 16px; }

a.dm-card-btn {
  display: block !important;
  text-align: center !important;
  background: #00aff0 !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 10px 14px !important;
  border-radius: 7px !important;
  text-decoration: none !important;
  font-family: 'Segoe UI', Arial, sans-serif !important;
  transition: background 0.15s, box-shadow 0.15s !important;
}
a.dm-card-btn:hover {
  background: #009fd8 !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(0,175,240,0.4) !important;
}

.dm-no-results,
.dm-results-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: rgba(255,255,255,0.5);
  font-family: 'Segoe UI', Arial, sans-serif;
}
.dm-no-results svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: rgba(255,255,255,0.35);
  stroke-width: 1.5;
  stroke-linecap: round;
  margin-bottom: 12px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.dm-no-results p { margin: 0; font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════
   7. LOADING SPINNER
   ═══════════════════════════════════════════════════════════════ */

.dm-results-loading {
  text-align: center;
  padding: 32px;
}
.dm-results-loading[hidden] { display: none; }

.dm-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: #00aff0;
  border-radius: 50%;
  animation: dm-spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes dm-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   8. PAGINATION
   ═══════════════════════════════════════════════════════════════ */

.dm-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 28px 0 8px;
  font-family: 'Segoe UI', Arial, sans-serif;
}
.dm-pagination[hidden] { display: none; }

button.dm-page-btn {
  min-width: 38px !important;
  height: 38px !important;
  padding: 0 10px !important;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 7px !important;
  color: #f2f9ff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  font-family: 'Segoe UI', Arial, sans-serif !important;
  transition: all 0.15s !important;
}
button.dm-page-btn:hover:not(:disabled):not(.dm-page-active) {
  border-color: #00aff0 !important;
  color: #00aff0 !important;
  box-shadow: 0 0 16px rgba(0,175,240,0.22) !important;
}
button.dm-page-btn.dm-page-active {
  background: #00aff0 !important;
  border-color: #00aff0 !important;
  color: #fff !important;
  cursor: default !important;
  box-shadow: 0 0 16px rgba(0,175,240,0.35) !important;
}
button.dm-page-btn:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
}

button.dm-page-prev,
button.dm-page-next {
  padding: 0 14px !important;
  font-size: 12px !important;
}

.dm-page-ellipsis {
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  padding: 0 4px;
  line-height: 38px;
}

/* ═══════════════════════════════════════════════════════════════
   9. RESPONSIVE — TABLET (max-width: 900px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .dm-results-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .dm-filter-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .dm-filter-chips-group,
  .dm-filter-clear-group {
    grid-column: 1 / -1;
  }
  button.dm-search-btn {
    padding: 11px 16px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   10. RESPONSIVE — MOBILE (max-width: 540px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 540px) {
  .dm-search-panel { padding: 16px 14px 0; }
  .dm-results-grid {
    grid-template-columns: 1fr !important;
  }
  .dm-search-bar-row {
    flex-wrap: wrap;
  }
  .dm-search-input-wrap { width: 100%; }
  button.dm-search-btn { flex: 1; }
  button.dm-filter-toggle-btn { flex: 1; }
  .dm-filter-row {
    grid-template-columns: 1fr !important;
  }
  .dm-search-dropdown { border-radius: 0 0 8px 8px; }
  .dm-pagination { gap: 4px; }
  button.dm-page-btn { min-width: 34px !important; height: 34px !important; }
  button.dm-page-prev,
  button.dm-page-next { font-size: 11px !important; padding: 0 10px !important; }
}
