/**
 * Doctiva Home Search Premium - Layout Original + Champs Premium
 * Single border per field, clean focus states
 * 
 * @since 2.0.0
 */

/* ============================================
   SEARCH CARD - Style Premium sur Layout Original
   ============================================ */

/* Override les styles de base pour un look plus premium */
.search-card .search-card__inner {
  background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  padding: 20px;
}

@media (min-width: 768px) {
  .search-card .search-card__inner {
    padding: 24px 28px;
    border-radius: 24px;
  }
}

/* ============================================
   FORMULAIRE DE RECHERCHE - Layout Horizontal
   ============================================ */

.search-card .doctiva-search {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 768px) {
  .search-card .doctiva-search {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
  }
}

@media (min-width: 1024px) {
  .search-card .doctiva-search {
    flex-wrap: nowrap;
    gap: 12px;
  }
}

/* ============================================
   CHAMPS - Single Border Premium
   ============================================ */

.search-card .doctiva-search__field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f9fafb;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  flex: 1;
  min-width: 0;
}

/* Champ texte principal - plus large */
.search-card .doctiva-search__field--text {
  flex: 2;
  background: #ffffff;
  border-color: #94a3b8;
}

/* Selects - taille égale */
.search-card .doctiva-search__field--select {
  flex: 1;
  min-width: 140px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .search-card .doctiva-search__field--text {
    flex-basis: 100%;
  }
  
  .search-card .doctiva-search__field--select {
    flex: 1;
  }
}

/* Hover */
.search-card .doctiva-search__field:hover {
  border-color: #94a3b8;
  background: #f3f4f6;
}

.search-card .doctiva-search__field--text:hover {
  border-color: #64748b;
  background: #ffffff;
}

/* Focus - Google Flights style */
.search-card .doctiva-search__field:focus-within {
  border-color: #3174ff;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(49, 116, 255, 0.18);
}

/* ============================================
   ICÔNES DANS LES CHAMPS
   ============================================ */

.search-card .doctiva-search__field > svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #64748b;
  transition: color 0.15s ease;
}

.search-card .doctiva-search__field--text > svg {
  width: 22px;
  height: 22px;
  color: #475569;
}

.search-card .doctiva-search__field:focus-within > svg {
  color: #3174ff;
}

/* ============================================
   INPUTS & SELECTS - Transparents (tout sur le parent)
   ============================================ */

.search-card .doctiva-search__input,
.search-card .doctiva-search__select {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 15px;
  font-weight: 500;
  color: #0f172a;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit;
  line-height: 1.5;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
}

.search-card .doctiva-search__input {
  cursor: text;
}

.search-card .doctiva-search__input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.search-card .doctiva-search__input:focus,
.search-card .doctiva-search__select:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Select avec flèche custom */
.search-card .doctiva-search__field--select {
  position: relative;
}

.search-card .doctiva-search__field--select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #94a3b8;
  pointer-events: none;
  transition: border-color 0.15s ease;
}

.search-card .doctiva-search__field--select:focus-within::after {
  border-top-color: #3174ff;
}

.search-card .doctiva-search__select {
  padding-right: 28px !important;
}

/* ============================================
   BOUTON RECHERCHER
   ============================================ */

.search-card .doctiva-search__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: linear-gradient(135deg, #3174ff, #2563eb);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .search-card .doctiva-search__button {
    width: 100%;
    padding: 14px 20px;
  }
}

.search-card .doctiva-search__button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
}

.search-card .doctiva-search__button:active {
  transform: translateY(1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.search-card .doctiva-search__button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #3174ff, 0 8px 24px rgba(37, 99, 235, 0.35);
}

/* ============================================
   QUICKBAR (Chips + Liens)
   ============================================ */

.search-card .search-quickbar {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

/* Chips */
.search-card .quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

@media (min-width: 768px) {
  .search-card .quick-chips {
    justify-content: flex-start;
  }
}

.search-card .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  background: #ffffff;
  border-radius: 9999px;
  border: 1.5px solid #e5e7eb;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.search-card .chip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.search-card .chip:hover {
  background-color: #eff6ff;
  border-color: #3174ff;
  color: #1e40af;
  transform: translateY(-1px);
}

.search-card .chip:active {
  transform: scale(0.98) translateY(0);
}

.search-card .chip:focus-visible {
  outline: 2px solid #3174ff;
  outline-offset: 2px;
}

/* Liens SEO */
.search-card .quick-links {
  margin-top: 14px;
  font-size: 13px;
  color: #6b7280;
  text-align: left;
}

@media (min-width: 768px) {
  .search-card .quick-links {
    text-align: right;
  }
}

.search-card .quick-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.search-card .quick-links a:hover {
  color: #3174ff;
  text-decoration: underline;
}

.search-card .quick-links .sep {
  margin: 0 8px;
  color: #d1d5db;
}

/* ============================================
   RESPONSIVE - Mobile
   ============================================ */

@media (max-width: 767px) {
  .search-card .search-card__inner {
    padding: 16px;
    border-radius: 18px;
  }
  
  .search-card .doctiva-search__field {
    padding: 12px 14px;
    border-radius: 12px;
  }
  
  .search-card .doctiva-search__input,
  .search-card .doctiva-search__select {
    font-size: 16px; /* Évite zoom iOS */
  }
  
  .search-card .chip {
    padding: 7px 12px;
    font-size: 12px;
  }
  
  .search-card .chip svg {
    width: 14px;
    height: 14px;
  }
  
  .search-card .quick-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .search-card .quick-chips::-webkit-scrollbar {
    display: none;
  }
  
  .search-card .chip {
    flex-shrink: 0;
  }
}

/* ============================================
   TRÈS PETITS ÉCRANS
   ============================================ */

@media (max-width: 380px) {
  .search-card .search-card__inner {
    padding: 14px;
    border-radius: 16px;
  }
  
  .search-card .doctiva-search__field {
    padding: 11px 12px;
    border-radius: 10px;
  }
  
  .search-card .doctiva-search__field > svg {
    width: 18px;
    height: 18px;
  }
  
  .search-card .doctiva-search__button {
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 10px;
  }
}

/* ============================================
   AUTOSUGGEST DROPDOWN
   ============================================ */

.search-card .autosuggest-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.15);
  max-height: 280px;
  overflow-y: auto;
}

/* ============================================
   ACCESSIBILITÉ
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   ANIMATION ENTRÉE (optionnel)
   ============================================ */

@media (prefers-reduced-motion: no-preference) {
  .search-card .search-card__inner {
    animation: searchCardFadeIn 0.35s ease-out;
  }
  
  @keyframes searchCardFadeIn {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
