/* ============================================
   SGL - Search Page Styles
   ============================================ */

/* SEARCH HEADER */
.search-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--accent-dark));
  padding: calc(var(--navbar-height) + 2rem) 0 2.5rem;
  position: relative;
  overflow: hidden;
}

.search-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.search-page-title {
  color: white;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 0.5rem;
  position: relative;
}

.search-page-subtitle {
  color: rgba(255,255,255,0.8);
  margin-bottom: 1.5rem;
  position: relative;
}

/* Main search bar */
.search-bar-main {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-bar-inner {
  display: flex;
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
  position: relative;
  min-height: 60px;
}

.sbm-field {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  position: relative;
  min-width: 0;
}

.sbm-icon {
  color: var(--primary);
  font-size: 16px;
  margin-right: var(--space-3);
  flex-shrink: 0;
}

.sbm-input {
  border: none;
  background: none;
  font-size: var(--text-sm);
  color: var(--gray-800);
  width: 100%;
  padding: 1rem 0;
}

.sbm-input:focus { outline: none; }
.sbm-input::placeholder { color: var(--gray-400); }

.sbm-select {
  border: none;
  background: none;
  font-size: var(--text-sm);
  color: var(--gray-600);
  padding-right: 2rem;
  cursor: pointer;
  width: 100%;
}

.sbm-select:focus { outline: none; }

.sbm-divider {
  width: 1px;
  background: var(--gray-200);
  margin: 12px 0;
  flex-shrink: 0;
}

.sbm-btn {
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0 !important;
  padding: 0 2rem;
  white-space: nowrap;
}

/* Search Suggestions */
.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-100);
  z-index: var(--z-dropdown);
  display: none;
  overflow: hidden;
}

.search-suggestions.open { display: block; }

.suggestion-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.625rem var(--space-4);
  cursor: pointer;
  transition: var(--transition);
  font-size: var(--text-sm);
  color: var(--gray-700);
}

.suggestion-item:hover {
  background: var(--gray-50);
  color: var(--primary);
}

.suggestion-item i { color: var(--gray-400); }

/* Quick specialty tabs */
.quick-specialty-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  position: relative;
}

.qst-btn {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.qst-btn:hover,
.qst-btn.active {
  background: white;
  color: var(--primary);
  border-color: white;
}

/* SEARCH MAIN */
.search-main {
  padding: 2rem 0 4rem;
  background: var(--gray-50);
  min-height: 60vh;
}

.search-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-6);
  align-items: start;
}

/* FILTERS SIDEBAR */
.filters-sidebar {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-card);
  position: sticky;
  top: calc(var(--navbar-height) + 1rem);
}

.filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--gray-100);
}

.filters-header h3 {
  font-size: var(--text-base);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--gray-800);
}

.filter-group {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--gray-100);
}

.filter-group:last-child { border-bottom: none; }

.filter-title {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  margin-bottom: var(--space-3);
}

.filter-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 0;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--gray-700);
  transition: var(--transition);
}

.filter-check:hover { color: var(--primary); }

.filter-check input[type="checkbox"],
.filter-check input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* RESULTS */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.results-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.results-count {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--gray-800);
}

.results-query {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.results-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.view-toggle {
  display: flex;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-btn {
  width: 34px;
  height: 34px;
  background: white;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  border: none;
}

.view-btn.active,
.view-btn:hover {
  background: var(--primary);
  color: white;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  min-height: 300px;
}

.results-grid.list-view {
  grid-template-columns: 1fr;
}

/* Doctor Search Card */
.doc-search-card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.doc-search-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-lighter);
}

.doc-sc-banner {
  height: 70px;
  position: relative;
}

.doc-sc-body {
  padding: 0 var(--space-5) var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.doc-sc-avatar {
  margin-top: -32px;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.doc-verified-badge {
  background: rgba(46,204,113,0.1);
  color: var(--secondary);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}

.doc-sc-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.doc-sc-spec {
  font-size: var(--text-sm);
  color: var(--primary);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.doc-sc-crm {
  font-size: 11px;
  color: var(--gray-400);
  margin-bottom: var(--space-3);
}

.doc-sc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  color: var(--gray-500);
}

.doc-sc-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.doc-sc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-4);
  flex: 1;
}

.doc-sc-tag {
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
}

.doc-sc-footer {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
}

/* List view adjustments */
.results-grid.list-view .doc-search-card {
  flex-direction: row;
  align-items: stretch;
}

.results-grid.list-view .doc-sc-banner {
  width: 100px;
  height: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.results-grid.list-view .doc-sc-avatar {
  margin-top: 0;
  margin-bottom: 0;
  display: block;
}

.results-grid.list-view .doc-sc-body {
  flex-direction: row;
  align-items: center;
  gap: var(--space-4);
}

/* Loading skeleton */
.skeleton-card {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--gray-100);
}

.skeleton-banner {
  height: 70px;
}

.skeleton-body {
  padding: var(--space-5);
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-16);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  opacity: 0.3;
}

.empty-state h3 {
  color: var(--gray-500);
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.empty-state p {
  color: var(--gray-400);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .search-layout {
    grid-template-columns: 240px 1fr;
  }
}

@media (max-width: 768px) {
  .search-layout {
    grid-template-columns: 1fr;
  }

  .filters-sidebar {
    position: static;
    display: none;
  }

  .filters-sidebar.mobile-open {
    display: block;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .search-bar-inner {
    flex-direction: column;
    border-radius: var(--radius-lg);
  }

  .sbm-divider { width: 100%; height: 1px; margin: 0; }

  .sbm-btn {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
    width: 100%;
    padding: 0.875rem;
  }
}
