/**
 * Barre de recherche Médecins - PREMIUM DESIGN (style DabaDoc)
 * 
 * Desktop: Centrée dans le container
 * Mobile: Full width, sticky en haut
 */

.searchbar-wrapper {
  padding: 32px 0 24px;
  background: transparent;
  position: relative;
}

/* Dégradé bleu foncé comme page d'accueil */
.searchbar-wrapper::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 0;
  right: 0;
  height: 400px;
  background: linear-gradient(180deg, 
    #0F1F3D 0%, 
    #1a2f50 25%,
    #1e3a5f 50%,
    rgba(30, 58, 95, 0.8) 75%,
    rgba(30, 58, 95, 0.3) 90%,
    transparent 100%
  );
  z-index: -1;
  pointer-events: none;
}

.searchbar-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(226, 232, 240, 0.6) 50%, transparent 100%);
  box-shadow: 0 8px 16px -4px rgba(2, 6, 23, .08);
}

@media (max-width: 768px) {
  .searchbar-wrapper {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky, 50);
    background: linear-gradient(180deg, #0F1F3D 0%, #1a2f50 50%, rgba(30, 58, 95, 0.95) 100%);
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(2, 6, 23, .06);
  }
  
  .searchbar-wrapper::before {
    display: none;
  }
  
  .searchbar-wrapper::after {
    display: none;
  }
}

.searchbar-medecins {
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
  border: 2px solid var(--card-border, #E2E8F0);
  border-radius: var(--radius-lg, 18px);
  box-shadow: 
    0 2px 4px rgba(2, 6, 23, .06),
    0 8px 20px rgba(2, 6, 23, .08),
    0 1px 2px rgba(15, 23, 42, .04);
  padding: 20px;
  margin-bottom: 0;
  position: relative;
}

@media (min-width: 768px) {
  .searchbar-medecins {
    padding: 22px 24px;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .searchbar-medecins {
    border-radius: var(--radius-md, 14px);
    box-shadow: 0 2px 8px rgba(2, 6, 23, .08);
  }
}

.searchbar-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Pills de raccourcis (style page d'accueil) */
.searchbar-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.shortcut-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--bg-100, #F1F5F9);
  color: var(--ink-700, #1E293B);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.shortcut-pill:hover {
  background: var(--halo-bg, rgba(37, 99, 235, .12));
  color: var(--brand-600, #2563EB);
  border-color: var(--brand-400, #60A5FA);
  transform: translateY(-1px);
}

.shortcut-pill.shortcut-all {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 13px;
  font-weight: 500;
  opacity: 0.85;
}

.shortcut-pill.shortcut-all:hover {
  background: var(--bg-50, #F8FAFC);
  color: var(--brand-600, #2563EB);
  border-color: var(--brand-400, #60A5FA);
  opacity: 1;
}

@media (max-width: 640px) {
  .searchbar-shortcuts {
    gap: 6px;
  }
  
  .shortcut-pill {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* Champs de recherche - Layout DabaDoc style */
.searchbar-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

@media (min-width: 768px) {
  .searchbar-inputs {
    flex-wrap: nowrap;
  }
}

.searchbar-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

/* Champ texte plus large */
.searchbar-field-text {
  flex: 2 1 280px;
}

@media (max-width: 767px) {
  .searchbar-field-text {
    flex: 1 1 100%;
  }
  
  .searchbar-field {
    flex: 1 1 calc(50% - 6px);
  }
  
  .searchbar-field:last-child {
    flex: 1 1 100%;
  }
}

/* Inputs & Selects - PREMIUM */
.searchbar-input,
.searchbar-select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--card-border, #E7ECF3);
  border-radius: var(--radius-sm, 10px);
  background: #FFFFFF;
  color: var(--ink-900, #0F172A);
  font-size: 14px;
  font-family: var(--font-body, "Inter", sans-serif);
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  appearance: none;
  box-shadow: 0 1px 2px rgba(2, 6, 23, .03);
}

.searchbar-input:hover,
.searchbar-select:hover {
  border-color: var(--brand-400, #60A5FA);
  box-shadow: 0 2px 8px rgba(37, 99, 235, .08);
}

.searchbar-input:focus,
.searchbar-select:focus {
  outline: none;
  border-color: var(--brand-500, #3B82F6);
  box-shadow: 
    0 0 0 4px var(--halo-bg, rgba(37, 99, 235, .12)),
    0 4px 12px rgba(37, 99, 235, .15);
  transform: translateY(-1px);
}

.searchbar-input::placeholder {
  color: var(--ink-400, #94A3B8);
  font-weight: 400;
}

.searchbar-select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%23334155' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  cursor: pointer;
}

/* Bouton Rechercher - PREMIUM */
.searchbar-btn {
  width: 100%;
  min-width: 140px;
  height: 46px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-500) 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm, 10px);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body, "Inter", sans-serif);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 
    0 2px 8px rgba(37, 99, 235, .2),
    0 8px 24px rgba(37, 99, 235, .15);
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .searchbar-btn {
    width: auto;
  }
}

.searchbar-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s;
}

.searchbar-btn:hover {
  background: linear-gradient(135deg, var(--brand-700, #1D4ED8) 0%, var(--brand-600) 100%);
  transform: translateY(-2px);
  box-shadow: 
    0 4px 12px rgba(37, 99, 235, .25),
    0 12px 32px rgba(37, 99, 235, .2);
}

.searchbar-btn:hover::before {
  opacity: 1;
}

.searchbar-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, .2);
}

.searchbar-icon {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .searchbar-btn-text {
    display: none;
  }
  
  .searchbar-btn {
    padding: 0 16px;
  }
}

/* RTL support (Arabe) */
[dir="rtl"] .searchbar-filters,
[dir="rtl"] .searchbar-inputs {
  direction: rtl;
}

[dir="rtl"] .searchbar-select {
  padding-left: 36px;
  padding-right: 14px;
  background-position: left 12px center;
}

/* Animation d'entrée */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.searchbar-medecins {
  animation: slideDown 0.4s ease-out;
}

/* Loading state (optionnel) */
.searchbar-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.searchbar-btn.loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

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

/* Responsive adjustments */
@media (max-width: 480px) {
  .searchbar-filters {
    gap: 6px;
  }
  
  .filter-pill {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  .searchbar-inputs {
    gap: 8px;
  }
  
  .searchbar-input,
  .searchbar-select,
  .searchbar-btn {
    height: 40px;
    font-size: 13px;
  }
}

