/* ============================================
   BIO-CLINIC CLINICAL SEARCH ENGINE STYLES
   Version: 2.0.0
   AI-First Clinical Knowledge Search
   ============================================ */

/* ===== HERO SEARCH (Homepage) ===== */
.hero-search {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 4rem 0 5rem;
  text-align: center;
  position: relative;
  z-index: 100;
  overflow: visible;
}

.hero-search::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 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.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-search .container {
  position: relative;
  z-index: 100;
}

.hero-search-title {
  color: white;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-family: 'Poppins', sans-serif;
}

.hero-search-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Search Box - Hero (Large) */
.search-box-hero {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 99999;
}

.search-box-hero .search-input-wrapper {
  display: flex;
  background: white;
  border-radius: 50px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.search-box-hero .search-input-wrapper:focus-within {
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.search-box-hero .search-input {
  flex: 1;
  border: none;
  padding: 1.25rem 1.5rem 1.25rem 1.5rem;
  font-size: 1.125rem;
  outline: none;
  background: transparent;
}

.search-box-hero .search-input::placeholder {
  color: var(--gray-400);
}

.search-box-hero .search-btn {
  background: var(--primary);
  border: none;
  padding: 0 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.search-box-hero .search-btn:hover {
  background: var(--primary-dark);
}

.search-box-hero .search-btn svg {
  width: 24px;
  height: 24px;
  stroke: white;
}

/* Search Suggestions (Quick Links) */
.search-suggestions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.search-suggestion-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-suggestion-tag:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.search-suggestion-tag svg {
  width: 14px;
  height: 14px;
}

/* ===== HEADER SEARCH (Compact) ===== */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search-toggle {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.header-search-toggle:hover {
  background: var(--gray-100);
}

.header-search-toggle svg {
  width: 20px;
  height: 20px;
  stroke: var(--gray-600);
}

.header-search-expanded {
  position: absolute;
  top: 100%;
  right: 0;
  width: 400px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.header-search-expanded.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(5px);
}

.header-search-expanded .search-input-wrapper {
  display: flex;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}

.header-search-expanded .search-input-wrapper:focus-within {
  border-color: var(--primary);
}

.header-search-expanded .search-input {
  flex: 1;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  outline: none;
}

.header-search-expanded .search-btn {
  background: var(--primary);
  border: none;
  padding: 0 1rem;
  cursor: pointer;
}

.header-search-expanded .search-btn svg {
  width: 20px;
  height: 20px;
  stroke: white;
}

/* ===== SEARCH RESULTS OVERLAY ===== */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===== SEARCH RESULTS PANEL ===== */
.search-results-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 600px;
  height: 100vh;
  background: white;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.search-results-panel.active {
  transform: translateX(0);
}

/* Results Header */
.search-results-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-results-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
}

.search-results-close {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.search-results-close:hover {
  background: var(--gray-100);
}

.search-results-close svg {
  width: 24px;
  height: 24px;
  stroke: var(--gray-600);
}

/* Results Content */
.search-results-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

/* Loading State */
.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--gray-500);
}

.search-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* No Results */
.search-no-results {
  text-align: center;
  padding: 3rem;
}

.search-no-results-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  stroke: var(--gray-300);
}

.search-no-results h4 {
  color: var(--gray-700);
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.search-no-results p {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* ===== RESULT SECTIONS ===== */
.search-result-section {
  margin-bottom: 1.5rem;
}

.search-result-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.search-result-section-title svg {
  width: 16px;
  height: 16px;
}

/* ===== UPLINK SUGGESTION ===== */
.search-uplink {
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(34, 197, 94, 0.1) 100%);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.search-uplink-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--primary);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.search-uplink-badge svg {
  width: 12px;
  height: 12px;
}

.search-uplink-title {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.search-uplink-message {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.search-uplink-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
}

.search-uplink-cta:hover {
  background: var(--primary-dark);
}

/* ===== RESULT CARDS ===== */
.search-result-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.search-result-card:hover {
  background: var(--gray-100);
  transform: translateX(4px);
}

.search-result-card-icon {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-result-card-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
}

.search-result-card-icon.specialty-gyn { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); }
.search-result-card-icon.specialty-gyn svg { stroke: #be185d; }

.search-result-card-icon.specialty-card { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); }
.search-result-card-icon.specialty-card svg { stroke: #dc2626; }

.search-result-card-icon.specialty-endo { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); }
.search-result-card-icon.specialty-endo svg { stroke: #2563eb; }

.search-result-card-icon.specialty-lab { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); }
.search-result-card-icon.specialty-lab svg { stroke: #059669; }

.search-result-card-icon.specialty-derm { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); }
.search-result-card-icon.specialty-derm svg { stroke: #d97706; }

.search-result-card-icon.specialty-default { background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%); }
.search-result-card-icon.specialty-default svg { stroke: var(--gray-600); }

.search-result-card-content {
  flex: 1;
  min-width: 0;
}

.search-result-card-title {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-result-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.search-result-card-desc {
  color: var(--gray-600);
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.search-result-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.search-result-card-meta-item svg {
  width: 12px;
  height: 12px;
}

/* Preparation Icons */
.search-prep-icons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.search-prep-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 4px;
}

.search-prep-icon.fasting { background: #fee2e2; color: #991b1b; }
.search-prep-icon.urine { background: #dbeafe; color: #1e40af; }
.search-prep-icon.morning { background: #fef3c7; color: #92400e; }

/* ===== PHYSICIAN CARDS ===== */
.search-physician-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.search-physician-card:hover {
  background: var(--gray-100);
  transform: translateX(4px);
}

.search-physician-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
}

.search-physician-card-content {
  flex: 1;
}

.search-physician-name {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.9375rem;
  margin-bottom: 0.125rem;
}

.search-physician-specialty {
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.search-physician-procedures {
  color: var(--gray-500);
  font-size: 0.75rem;
}

.search-physician-cta {
  background: var(--primary);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  align-self: center;
  white-space: nowrap;
}

/* ===== PACK CARDS ===== */
.search-pack-card {
  background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.search-pack-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1);
}

.search-pack-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.search-pack-name {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 1rem;
}

.search-pack-savings {
  background: #dcfce7;
  color: #166534;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.search-pack-benefit {
  color: var(--gray-600);
  font-size: 0.8125rem;
  margin-bottom: 0.75rem;
}

.search-pack-exams {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.search-pack-exam-tag {
  background: white;
  border: 1px solid var(--gray-200);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  color: var(--gray-600);
}

.search-pack-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
}

.search-pack-cta:hover {
  background: var(--primary-dark);
}

/* ===== AUTOCOMPLETE DROPDOWN ===== */
.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  margin-top: 0.5rem;
  max-height: 70vh;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 999999;
}

.search-autocomplete.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--gray-100);
}

.search-autocomplete-item:last-child {
  border-bottom: none;
}

.search-autocomplete-item:hover,
.search-autocomplete-item.active {
  background: var(--gray-50);
}

.search-autocomplete-icon {
  width: 32px;
  height: 32px;
  background: var(--gray-100);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-autocomplete-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--gray-600);
}

.search-autocomplete-text {
  flex: 1;
}

.search-autocomplete-title {
  font-weight: 500;
  color: var(--gray-800);
  font-size: 0.875rem;
}

.search-autocomplete-subtitle {
  color: var(--gray-500);
  font-size: 0.75rem;
}

.search-autocomplete-type {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-400);
  padding: 0.25rem 0.5rem;
  background: var(--gray-100);
  border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-search {
    padding: 2.5rem 1rem 3rem;
  }
  
  .hero-search-title {
    font-size: 1.5rem;
  }
  
  .hero-search-subtitle {
    font-size: 1rem;
  }
  
  .search-box-hero .search-input {
    padding: 1rem;
    font-size: 1rem;
  }
  
  .search-box-hero .search-btn {
    padding: 0 1.25rem;
  }
  
  .search-suggestions {
    gap: 0.375rem;
  }
  
  .search-suggestion-tag {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .search-results-panel {
    max-width: 100%;
  }
  
  .header-search-expanded {
    width: calc(100vw - 2rem);
    right: -1rem;
  }
  
  .search-result-card {
    padding: 0.875rem;
  }
  
  .search-result-card-icon {
    width: 40px;
    height: 40px;
  }
  
  .search-result-card-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* ===== DARK MODE SUPPORT (future) ===== */
@media (prefers-color-scheme: dark) {
  /* Placeholder for dark mode styles */
}
