/**
 * =============================================================================
 * Styles pour la barre de recherche d'emails
 * =============================================================================
 */

.email-search-container {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.email-search-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex: 1;
  min-width: 250px;
  background: white;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.email-search-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1),
              0 1px 3px rgba(0, 0, 0, 0.05);
}

.email-search-icon {
  font-size: 1.2rem;
  color: #94a3b8;
  flex-shrink: 0;
}

#emailSearchInput {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  color: #1e293b;
  font-family: inherit;
  min-width: 150px;
  padding: 0.25rem 0;
}

#emailSearchInput::placeholder {
  color: #cbd5e1;
  font-weight: 400;
}

#emailSearchInput::-webkit-search-cancel-button {
  display: none;
}

.email-search-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

#emailSearchClear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 1.1rem;
  color: #64748b;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

#emailSearchClear:hover {
  background: #e2e8f0;
  color: #334155;
  border-color: #cbd5e1;
}

#emailSearchClear:active {
  background: #cbd5e1;
  transform: scale(0.95);
}

#emailSearchStats {
  display: none;
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  background: white;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Animations */
@keyframes searchPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.email-search-container.searching #emailSearchStats {
  animation: searchPulse 1.5s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .email-search-container {
    padding: 0.75rem;
    gap: 0.4rem;
  }

  .email-search-wrapper {
    min-width: 200px;
    padding: 0.4rem 0.5rem;
  }

  #emailSearchInput {
    font-size: 0.95rem;
    min-width: 100px;
  }

  #emailSearchStats {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
  }

  #emailSearchClear {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .email-search-container {
    padding: 0.5rem;
    gap: 0.3rem;
    flex-direction: column;
    align-items: stretch;
  }

  .email-search-wrapper {
    min-width: auto;
    width: 100%;
  }

  #emailSearchStats {
    width: 100%;
    text-align: center;
    white-space: normal;
  }
}

/* Intégration avec d'autres éléments */
.center-content {
  width: 100%;
}

.center-content > .email-search-container {
  margin-top: 0;
}

/* État vide */
.no-emails-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: #64748b;
  font-size: 1.1rem;
}

.no-emails-message::before {
  font-size: 3rem;
  margin-bottom: 1rem;
}
