@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

body {
    font-family: 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    justify-content: right;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    /* l'image de fond par défaut sera gérée en JS */
    background: none;
    color: #333;
}

/* Calques pour l'arrière-plan animé */
.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 2s ease-in-out;
    z-index: -10;
    opacity: 0;
}
.bg1 { z-index: -11; }
.bg2 { z-index: -12; }

.bg-image.bg1 {
    background-image: url('/assets/400515_panorama_xl.ori-C9c9bEKM.jpg');
    opacity: 1;
}

/*
.voice-agent-container {
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    overflow: hidden;
}
*/
.voice-agent-container {
    position: relative;
    background: rgba(245, 236, 236, 0.65);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(97, 15, 15, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 300px;
    text-align: center;
    overflow: hidden;
}
    

.header h1 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: #621b2f;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    font-family: 'Helvetica Neue';
    text-align: center;
}


.header p {
    margin: 0 0 30px;
    font-family: 'Helvetica Neue';
    color: #5f3535;
    font-size: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: #555;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.status-dot.ready { background-color: #4caf50; }
.status-dot.listening { background-color: #ff9800; }
.status-dot.speaking { background-color: #2196f3; }
.status-dot.processing { background-color: #9c27b0; }
.status-dot.error { background-color: #f44336; }

.voice-button {
    width: 100%;
    box-sizing: border-box;
    height: auto;
    padding: 15px;
    border-radius: 20px;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 25px;
}

.voice-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background-color: rgba(255, 255, 255, 0.2);
}

.logo-img {
    width: 150px;
    margin-bottom: 20px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.mic-container {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #621b2f;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.mic-container i {
    font-size: 1.5rem;
    margin-right: 10px;
}

.voice-button.recording .mic-container {
    animation: pulse-text 1.5s infinite;
}

.voice-button i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.settings-button {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.settings-button:hover {
    color: #333;
}

.powered-by-container {
    position: absolute;
    bottom: 10px;
    right: 20px;
    text-align: right;
}

.powered-by-container p {
    font-size: 0.6rem;
    color: #44444474;
    margin: 1px;
    font-weight: bold;
}

.voxperience-logo {
    width: 60px;
    height: auto;
    opacity: 0.7;
    display: block;
    margin-top: 2px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    position: relative;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

.save-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background-color: #764ba2;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.save-button:hover {
    background-color: #667eea;
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

.notification.success {
  background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
}

.notification.error {
  background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
}

.notification.warning {
  background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
  color: #2d3436;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes pulse-text {
    0% { color: #f0f0f0; }
    50% { color: #ffffff; }
    100% { color: #f0f0f0; }
}

.speaking-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    height: 20px;
}
.speaking-dots .dot {
    width: 10px;
    height: 10px;
    margin: 0 4px;
    border-radius: 50%;
    background: #FFC300;
    opacity: 0.4;
    animation: speaking-blink 1s infinite;
}
.speaking-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}
.speaking-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes speaking-blink {
    0%, 80%, 100% { opacity: 0.4; }
    40% { opacity: 1; }
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}
.waves {
    display: flex;
    flex-direction: row;
}
.waves-left {
    margin-right: 6px;
    flex-direction: row-reverse;
}
.waves-right {
    margin-left: 6px;
}
.wave {
    width: 4px;
    height: 12px;
    background: #FFC300;
    border-radius: 2px;
    margin: 0 1px;
    transform-origin: center bottom;
    animation: waveScale 1s infinite ease-in-out;
    visibility: hidden;
}
.wave:nth-child(1) { animation-delay: 0s; }
.wave:nth-child(2) { animation-delay: 0.15s; }
.wave:nth-child(3) { animation-delay: 0.3s; }

.voice-button.speaking .wave {
    visibility: visible;
}

@keyframes waveScale {
    0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* --- Styles pour la page Chat --- */
.chat-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  height: 100vh;
  background: none;
  font-family: Arial, sans-serif;
}
.chat-header {
  background: transparent;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-vox {
  width: 160px;
  height: auto;
}
.chat-container {
  position: relative;
  background: rgba(245, 236, 236, 0.75);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(97, 15, 15, 0.1);
  padding: 1rem;
  width: 100%;
  max-width: 350px;
  margin: 5rem 2rem 2rem auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.messages {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}
.message {
  position: relative;
  padding: 0.25rem 0.6rem 1rem 0.6rem;
  margin-bottom: 0.3rem;
  border-radius: 8px;
  max-width: 70%;
  line-height: 1.4;
  font-size: 0.75rem;
}
.message.user {
  align-self: flex-end;
  background: #ffd36b;
  margin-left: auto;
  border-top-right-radius: 0;
}
.message.agent {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #ddd;
  margin-right: auto;
  border-top-left-radius: 0;
  position: relative;
  margin-top: 1.6rem;
}
.message.system {
  align-self: center;
  background: #eee;
  font-style: italic;
}
.message.typing {
  display: flex;
  gap: 4px;
  padding: 0.6rem;
}
.message.typing .dot {
  width: 6px;
  height: 6px;
  background: #941c34;
  border-radius: 50%;
  opacity: 0.3;
  animation: typingBlink 1.2s infinite;
}
.message.typing .dot:nth-child(2) { animation-delay: 0.2s; }
.message.typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBlink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  margin-top: 0.5rem;
  background: none;
  box-shadow: none;
  padding: 0;
}
.input-area {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 24px;
  padding: 0.1rem 0.5rem 0.1rem 0.5rem;
  box-shadow: 0 2px 8px rgba(97, 15, 15, 0.07);
  flex: 1;
  gap: 0.2rem;
  min-height: 38px;
}
.input-area textarea {
  flex: 1;
  min-height: 22px;
  max-height: 220px;
  resize: none;
  border: none;
  outline: none;
  padding: 0.3rem 0.5rem;
  border-radius: 16px;
  font-size: 1rem;
  background: transparent;
  line-height: 1.3;
  transition: box-shadow 0.2s;
  box-shadow: none;
  font-family: 'Helvetica Neue', 'Roboto', Arial, sans-serif;
  margin: 0;
  align-self: center;
}
.input-area textarea::placeholder {
  color: #bbb;
  font-family: 'Helvetica Neue', 'Roboto', Arial, sans-serif;
  font-size: 1rem;
  opacity: 1;
}
.emoji-button {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #FFC300;
  cursor: pointer;
  margin: 0 0.2rem 0 0.1rem;
  align-self: center;
  padding: 0;
  height: 32px;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.send-button {
  background: #FFC300;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(97, 15, 15, 0.07);
  cursor: pointer;
  margin-left: 0.1rem;
  transition: background 0.2s;
  align-self: center;
  font-size: 1.3rem;
}
.send-button i {
  color: #fff;
  font-size: 1.3rem;
  margin: 0;
}
.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* --- Fin styles chat --- */

.timestamp {
  position: absolute;
  bottom: 0.2rem;
  right: 0.5rem;
  font-size: 0.65rem;
  color: #888;
}

.message p {
  margin: 0.1rem 0 0 0;
  padding: 0;
}

/* Tails des bulles */
.message.user::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 0.4rem;
  width: 0;
  height: 0;
  border-left: 6px solid #ffd36b;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.message.agent::after {
  content: "";
  position: absolute;
  left: -6px;
  bottom: 0.4rem;
  width: 0;
  height: 0;
  border-right: 6px solid #fff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  /* si bordure agent */
  box-shadow: -1px 0 0 #ddd; /* pour prolonger le contour */
}

.logo-top-left {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 20;
}
.logo-top-left img {
  width: 160px;
  height: auto;
}

.logo-top-right {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
  }
  .logo-top-right img {
    width: 160px;
    height: auto;
  }

.chat-title {
  font-family: 'Helvetica Neue';
  text-align: center;
  color: #621b2f;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.chat-title .subtitle {
  font-weight: 700;
}

/* --- Header agent dans les messages --- */
.agent-header {
  position: absolute;
  top: -1.3rem;
  left: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0;
  z-index: 2;
}
.agent-logo {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  /*background: rgba(245, 236, 236, 0.75);*/
  /*box-shadow: 0 1px 4px rgba(0,0,0,0.07);*/
  object-fit: contain;
}
.agent-name {
  font-weight: 600;
  color: #621b2f;
  font-size: 0.8rem;
  margin-left: 0.05rem;
  line-height: 1.2;
}
/* --- Fin header agent --- */

/* --- Emoji Picker --- */
.emoji-picker {
  position: absolute;
  z-index: 1000;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.13);
  padding: 0.3rem 0.5rem;
  display: flex;
  gap: 0.2rem;
  margin-top: 2px;
  border: 1px solid #eee;
}
.emoji-item {
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.emoji-item:hover {
  background: #ffe9a7;
}
/* --- Fin Emoji Picker --- */

.link-preview {
  background: rgba(220, 220, 220, 0.75); /* gris clair, semi-transparent */
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 8px 12px;
  margin: 8px 0 0 0;
  font-size: 0.92em;
  color: #333;
  display: flex;
  align-items: flex-start;
  min-height: 60px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.link-preview img {
  max-width: 60px;
  max-height: 60px;
  border-radius: 6px;
  margin-right: 10px;
  object-fit: cover;
}
.link-preview a {
  color: #941c34;
  font-size: 0.9em;
  word-break: break-all;
}

.chat-link-index {
  position: fixed;
  left: 32px;
  right: auto;
  bottom: 32px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 200;
  color: #941c34;
  background: rgba(255,255,255,0.85);
  border-radius: 24px;
  box-shadow: 0 2px 8px rgba(97,15,15,0.07);
  padding: 0.5em 1.2em;
  transition: background 0.2s, color 0.2s;
}
.chat-link-index:hover {
  background: #ffe9e9;
  color: #621b2f;
}

/* Responsive : centrer la boîte du chat sur mobile */
@media (max-width: 600px) {
  .chat-container {
    margin: 5rem auto 2rem auto !important;
    left: 0;
    right: 0;
  }
  .voice-agent-container {
    margin: 5rem auto 2rem auto !important;
    left: 0;
    right: 0;
  }
}

.chat-logos-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
}
.logo-nomade-left {
  height: 38px;
  width: auto;
  margin-left: 0.2rem;
}
.logo-voxperience-right {
  height: 38px;
  width: auto;
  margin-right: 0.2rem;
}

.logo-nomade-dialogue {
  width: 100%;
  max-width: 300px;
  margin: 0 auto 0.5rem auto;
  display: flex;
  align-items: flex-start;
}
.logo-nomade-dialogue img {
  height: 38px;
  width: auto;
  margin-left: 0;
}

/* Positionnement précis du logo par rapport à la boîte */
@media (min-width: 600px) {
  .voice-agent-container {
    margin-top: 3.5rem;
  }
}

.logos-row-inbox {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
}
.logo-nomade-inbox {
  height: 60px;
  width: auto;
  margin-left: 1.4rem;
}
.logo-vox-inbox {
  height: 60px;
  width: auto;
  margin-right: 1.4rem;
}

.voice-button.speaking .wave {
  animation: wave 1.5s ease-in-out infinite;
}

.speaker-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50px;
  color: white;
  padding: 15px 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 250px;
  margin-left: auto;
  margin-right: auto;
}

.speaker-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.speaker-button.speaker-active {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.speaker-button.speaker-active:hover {
  box-shadow: 0 12px 35px rgba(255, 107, 107, 0.4);
}

.speaker-button i {
  font-size: 18px;
}

.speaker-button span {
  font-size: 14px;
}