* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.logo {
  height: 40px; /* Ajuste la taille selon tes besoins */
  vertical-align: middle;
  margin-right: 10px;
}

/* Utility class for screen reader only content */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-container {
  background-color: white;
  width: 100%;
  height: 100vh;
  max-width: 70ch;
  display: flex;
  flex-direction: column;
}

.top-section {
  padding: 2rem;
  background-color: white;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
  text-align: center;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
}

.controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.btn {
  padding: 0.8rem 1.5rem;
  border: 3px solid #000;
  border-radius: 8px;
  background-color: #fff;
  color: #000;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
}

.btn:hover,
.btn:focus {
  background-color: #000;
  color: #fff;
}

.btn:disabled {
  background-color: #fff;
  border-color: #aeaeae;
  color: #aeaeae;
  cursor: not-allowed;
}

.status {
  color: #666;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.visualizers {
  margin-top: 2rem;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.visualizer-container {
  flex: 1 1 0;
  display: grid;
  max-width: 250px;
    /* max limite */
    min-width: 120px;
}

.visualizer {
  grid-column: 1;
  grid-row: 1;
  border: 1px solid #ccc;
  border-radius: 50%;
  background-color: #fff;
  width: 100%;
    aspect-ratio: 1 / 1;
    /* Cercle parfait */
}

.visualizer-label {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
    align-self: end;
    margin-bottom: 0.5rem;
    font-size: clamp(0.8rem, 1vw + 0.5rem, 1.2rem);
    /* Texte responsive */
  }
  
  /* Optionnel: Ajustement fin pour ultra petits écrans */
  @media (max-width: 400px) {
    .visualizer-container {
      max-width: 40%;
      min-width: 100px;
    }
}

/* Chat section styles */
.chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Important for scroll to work */
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  margin-bottom: 0.5rem;
}

.message-content {
  max-width: 70%;
  padding: 0.8rem 1.2rem;
  border-radius: 1rem;
  font-size: 1rem;
  line-height: 1.4;
}

.ai-message {
  justify-content: flex-start;
}

.ai-message .message-content {
  background-color: #f0f0f0;
  color: #333;
  border-bottom-left-radius: 0.3rem;
}

.user-message {
  justify-content: flex-end;
}

.user-message .message-content {
  background-color: #007AFF;
  color: white;
  border-bottom-right-radius: 0.3rem;
}

.chat-input-container {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  background-color: white;
  border-top: 1px solid #eee;
}

.chat-input {
  flex: 1;
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}

.chat-input:focus {
  border-color: #007AFF;
}

.send-button {
  padding: 0.8rem 1.5rem;
  background-color: #007AFF;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
}

.send-button:hover {
  background-color: #0056b3;
}

.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 500px;
  margin: 20px;
  position: relative;

  hr {
    margin-bottom: 2rem;
  }
}

.loader {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #333;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.close-btn {
  position: absolute;
  top: 5px;
  right: 10px;
  cursor: pointer;
  font-size: 18px;
}
