/* ===== GLOBAL ===== */
body {
    margin: 0;
    font-family: "Poppins", sans-serif;
    background: radial-gradient(circle at top, #1e1e1e, #0f0f0f);
    color: #fff;
    overflow-x: hidden;
    animation: fadeInPage 1.2s ease forwards;
}

@keyframes fadeInPage {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== BACKGROUND ANIMÉ (bulles rouges) ===== */
.bg-orbs div {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: floatOrb 12s ease-in-out infinite alternate;
    z-index: -1;
    transition: all 0.6s ease;
    cursor: pointer;
}

.bg-orbs .orb1 {
    width: 300px;
    height: 300px;
    background: #ff1a1a;
    top: 10%;
    left: -10%;
}

.bg-orbs .orb1:hover {
    background: #ff1a1a;
    filter: blur(40px);
    opacity: 0.8;
    transform: scale(1.2);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.6);
}

.bg-orbs .orb2 {
    width: 250px;
    height: 250px;
    background: #ff1a1a;
    bottom: 15%;
    right: -5%;
    animation-delay: 3s;
}

.bg-orbs .orb2:hover {
    background: #ff1a1a;
    filter: blur(30px);
    opacity: 0.9;
    transform: scale(1.3);
    box-shadow: 0 0 120px rgba(0, 0, 0, 0.7);
}

.bg-orbs .orb3 {
    width: 200px;
    height: 200px;
    background: #ff1a1a;
    top: 50%;
    left: 40%;
    animation-delay: 6s;
}

.bg-orbs .orb3:hover {
    background: #cc0000;
    filter: blur(20px);
    opacity: 1;
    transform: scale(1.4);
    box-shadow: 0 0 150px rgba(204, 0, 0, 0.8);
}

@keyframes floatOrb {
    0%   { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-60px) translateX(40px); }
}

/* ===== HEADER ===== */
header {
    padding: 90px 20px;
    text-align: center;
    animation: slideDown 1.3s ease forwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-25px); }
    to   { opacity: 1; transform: translateY(0); }
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to right, #ff3b3b, #ff6767);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1100px;
    margin: auto;
    padding: 40px 20px;
}

/* ===== GLASS CARD ===== */
.glass-card {
    background: rgba(255, 0, 0, 0.05);
    backdrop-filter: blur(14px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 0, 0, 0.2);
    box-shadow: 0 10px 40px rgba(255,0,0,0.25);
    animation: fadeUp 1s ease forwards;
    transform: translateY(20px);
}

.glass-card:nth-child(2) { animation-delay: 0.2s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.glass-card h2 {
    font-size: 1.8rem;
    background: linear-gradient(to right, #ff3b3b, #ff6767);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.glass-card p {
    font-size: 1.1rem;
    color: #f0f0f0;
    line-height: 1.7;
}

.responsive-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-top: 15px;
    transition: transform 0.3s ease;
}

.responsive-img:hover {
    transform: scale(1.03);
}
.back-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #ff1a1a;
    background: rgba(255, 0, 0, 0.05);
    border: 2px solid rgba(255, 0, 0, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.2);
    margin-top: 20px;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 25px;
    margin-top: 60px;
    color: #ff4d4d;
    font-size: 0.9rem;
    animation: fadeInFooter 2s ease forwards;
}

@keyframes fadeInFooter {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== BOT INTERACTIF ===== */
#interactive-bot {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 80px;
  height: 80px;
  z-index: 1000;
  cursor: pointer;
  pointer-events: auto; /* Permettre les clics */
  transition: transform 0.3s ease;
}

#bot-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(255, 59, 59, 0.5);
  cursor: pointer;
}

/* ===== BULLE DE CHAT ===== */
#chat-bubble {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 450px); /* Responsive: 90% de la largeur d'écran max 450px */
  max-width: 500px;
  min-width: 320px;
  max-height: min(80vh, 600px); /* Responsive: 80% de la hauteur d'écran max 600px */
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid rgba(255, 59, 59, 0.7);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(255, 59, 59, 0.5);
  z-index: 10000; /* Augmenté pour être au-dessus de tout */
  display: flex;
  flex-direction: column;
  transition: all 0.4s ease;
  /* Etat cache par defaut */
  opacity: 0;
  scale: 0.8;
  pointer-events: none;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#chat-bubble.show {
  opacity: 1;
  scale: 1;
  pointer-events: auto;
}

#chat-bubble.hidden {
  opacity: 0;
  scale: 0.8;
  pointer-events: none;
}

#chat-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #ff3b3b;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.3s ease;
  pointer-events: auto;
}

#chat-close:hover {
  color: #ff6767;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 15px;
  min-height: 150px;
  max-height: min(40vh, 350px); /* Hauteur adaptative */
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 59, 59, 0.5) transparent;
}

#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 59, 59, 0.5);
  border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 59, 59, 0.7);
}

#chat-messages div {
  margin-bottom: 12px;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  box-sizing: border-box;
}

#chat-messages .bot-message {
  background: rgba(255, 59, 59, 0.2);
  color: #fff;
  align-self: flex-start;
  border-left: 4px solid #ff3b3b;
  margin-right: 20%;
  animation: messageSlideIn 0.3s ease-out;
}

#chat-messages .user-message {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  align-self: flex-end;
  text-align: right;
  border-right: 4px solid #ff6767;
  margin-left: 20%;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#chat-input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid rgba(255, 59, 59, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  margin-bottom: 10px;
  pointer-events: auto;
  resize: none;
  min-height: 40px;
  max-height: 80px;
  overflow-y: auto;
  box-sizing: border-box;
}

#chat-input:focus {
  outline: none;
  border-color: #ff3b3b;
  box-shadow: 0 0 10px rgba(255, 59, 59, 0.3);
}

#chat-send {
  padding: 10px;
  background: linear-gradient(45deg, #ff3b3b, #ff6767);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  pointer-events: auto;
}

#chat-send:hover {
  background: linear-gradient(45deg, #ff6767, #ff3b3b);
  transform: scale(1.05);
}

/* ===== RESPONSIVE POUR LE CHATBOT ===== */
@media (max-width: 480px) {
  #chat-bubble {
    width: 95vw;
    min-width: 280px;
    padding: 15px;
    border-radius: 15px;
  }

  #chat-messages {
    min-height: 120px;
    max-height: 250px;
    padding: 8px;
  }

  #chat-messages div {
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 8px;
  }

  #chat-input {
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 8px;
  }

  #chat-send {
    padding: 8px 12px;
    font-size: 13px;
  }
}

@media (max-height: 600px) {
  #chat-bubble {
    max-height: 90vh;
    top: 45%;
  }

  #chat-messages {
    max-height: 200px;
  }
}
@media (max-width: 480px) {
  .glass-card {
    padding: 20px;
    margin-bottom: 20px;
  }
}
/* ===== NOTIFICATION POPUP ===== */
#notification-popup {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 59, 59, 0.9);
  color: #fff;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(255, 59, 59, 0.5);
  font-size: 14px;
  font-weight: 600;
  z-index: 1002;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

#notification-popup.show {
  opacity: 1;
  transform: translateY(0);
}
.level-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 25px;
  line-height: 25px;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  color: white;
  user-select: none;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  z-index: 1000;
}

.level-beginner {
  background-color: #4caf50; /* vert */
}

.level-intermediate {
  background-color: #ff9800; /* orange */
}

.level-advanced {
  background-color: #f44336; /* rouge */
}

.hidden {
  display: none;
}
:root {
  --bg-light: #f4f4f4;
  --bg-dark: #0b0f14;
  --text-light: #111;
  --text-dark: #eaeaea;
}
