/* Search Form Styles */
/* Barre de chargement pour search-form-container */
.progress-tracker {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(135deg, #4b5563 0%, #1f2937 100%);
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 0 0 0.5rem 0.5rem;
  z-index: 10;
}

.search-form-container {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  margin-bottom: 2rem;
  margin-left: auto;
  margin-right: auto;
  position: relative; /* Nécessaire pour le positionnement absolu de la barre */
}

@media screen and (max-width: 767px) {
  .introText-hide {
    display: none;
  }
}

.search-form-grid {
  gap: 3rem;
  align-items: center;
  justify-content: center; /* Nouveau - centre les éléments enfants */
}

@media (min-width: 768px) {
  .search-form-grid {
      grid-template-columns: repeat(2, 1fr);
      display: flex;
  }
}

@media (min-width: 1024px) {
  .search-form-grid {
      grid-template-columns: repeat(5, 1fr);
  }
}

.chain-container {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.form-group {
  margin-bottom: 0.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="number"] {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  outline: none;
}

.form-group select:focus,
.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
  border-color: #6b7280;
  box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

.amount-group {
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .amount-input-group {
  display: flex;
  }

  .amount-input-group input {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
}

.amount-input-group button {
  background-color: #1f2937;
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  cursor: pointer;  
}

.amount-input-group button:hover {
  background-color: #111827;
}

.amount-input-group button:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.5);
}

@media (min-width: 768px) {
  .amount-input-group button {
    border-top-right-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
  }
}

@media (max-width: 768px) {
  .amount-input-group button {
    border-bottom-left-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
    width: 100%;
  }

  .amount-input-group input {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
}

/* Flèche centrale */
.arrow-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.arrow {
  font-size: 1.5rem;
}

/* Version mobile */
@media (max-width: 768px) {
    .arrow-container .arrow {
        display: inline-block;
        transform: rotate(90deg); /* Transforme → en ↓ */
        font-size: 1.2rem;
    }
    
    /* Option : ajuster l'espacement autour de la flèche */
    .arrow-container {
        padding: 6px 0; /* Plus d'espace vertical */
    }
}

#sourceTokenSuggestions, #targetTokenSuggestions {
  position: absolute;
  top: 100%; /* Place la suggestion juste en dessous */
  left: 0; /* Alignement à gauche avec l'input */
  width: 100%; /* Prend toute la largeur du conteneur */
  max-height: 200px;
  overflow-y: auto;
  background: white;
  border: 1px solid #d1d5db;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  z-index: 999;
  display: none;
}

#sourceTokenSuggestions div:hover, #targetTokenSuggestions div:hover {
  background-color: #f3f4f6;
}

/* Ajoutez ces styles à votre fichier CSS existant */
.token-suggestion {
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  background-color: white;
}

.token-suggestion img {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  margin-right: 0.75rem;
  object-fit: contain;
}

.token-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  margin-right: 0.75rem;
  object-fit: contain;
  flex-shrink: 0;
}

.token-text {
  white-space: nowrap;       /* Empêche le retour à la ligne */
  overflow: hidden;          /* Cache le texte qui dépasse */
  text-overflow: ellipsis;   /* Ajoute "..." quand le texte est coupé */
  flex-grow: 1;              /* Prend l'espace disponible */
  min-width: 0;              /* Permet le truncating dans un flex container */  
}

.token-input-container {
  position: relative;
  width: 100%; /* ou une largeur fixe comme 300px si vous préférez */
  display: inline-block; /* Contient le flux */
}

.token-input-container input {
  width: 100%;
  box-sizing: border-box;
  padding-left: 2rem; /* Espace par défaut pour l'icône */
}

.token-input-container input.has-icon {
  padding-left: 3.5rem; /* Augmenté quand icône visible */
  margin-right: -2.75rem; /* Seulement compenser la DIFFÉRENCE (2.5rem - 2rem) */
}

/* Panneau modale pour le formulaire mobile */
.mobile-form-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80%;
  background-color: white;
  z-index: 2000;
  display: none;
  flex-direction: column;
  padding: 20px;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  border-top-left-radius: 0px;
  border-top-right-radius: 0px;
  box-shadow: rgba(25, 32, 36, 0.16) 0px 3px 6px 0px, rgba(25, 32, 36, 0.04) 0px -1px 4px 0px;
  overflow-x: hidden;
  overflow-y: hidden;
  z-index: 2000;
  transition: transform 0.25s ease, opacity 0.25s ease-out;
  box-sizing: border-box;
}

.mobile-form-panel .mobile-form {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
}

.mobile-form-panel .search-form-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mobile-form-panel .chain-container {
  width: 100%;
}

.mobile-form-panel .amount-group {
  margin-top: 10px;
}

.mobile-form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1500;
  display: none;
}

/* En-tête du panneau mobile */
.mobile-panel-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px 20px;
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 10;
}

.mobile-panel-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}


/* Bouton de fermeture */
.close-mobile-form {
  position: absolute;
  display: flex;
  top: 8px;
  left: 0px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #4b5563;
  z-index: 10;
}
