/* ==============================
   🌗 VARIABLES GLOBALES
============================== */
:root {
  --bg-color: #0e0e10;
  --text-color: #f1f1f1;
  --accent: #007bff;
  --card-bg: #18181b;
  --nav-bg: rgba(20, 20, 25, 0.8);
  --shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  --transition: all 0.3s ease;
}

[data-theme="light"] {
  --bg-color: #f5f5f5;
  --text-color: #111;
  --card-bg: #fff;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* ==============================
   🧱 BASE
============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  transition: var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==============================
   🧭 NAVBAR
============================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.logo span {
  font-size: 1.4em;
  font-weight: 600;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  padding: 8px 15px;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--accent);
  color: #fff;
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3em;
  color: var(--text-color);
  transition: var(--transition);
}

/* ==============================
   🎬 HERO SECTION
============================== */
.hero {
  position: relative;
  width: 100%;
  height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
  padding: 20px;
}

.hero-logo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin-bottom: 50px;
  object-fit: cover;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.hero-content h2 {
  font-size: 2.6em;
  margin-bottom: 10px;
}

.hero-content h2 span {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0, 123, 255, 0.8);
  font-weight: 700;
}

.hero-content p {
  font-size: 1.2em;
  max-width: 650px;
  margin: 0 auto 20px;
}

.hero-content .btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.hero-content .btn:hover {
  background: #0056c7;
  transform: scale(1.05);
}

/* ==============================
   💠 FEATURES
============================== */
.features {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  padding: 60px 20px;
}

.card {
  background: var(--card-bg);
  padding: 25px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  width: 300px;
  text-align: center;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 0 20px var(--accent);
}

/* ==============================
   🧩 MODALES
============================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(5px);
}

.modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-content {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 700px;
  box-shadow: var(--shadow);
  overflow-y: auto;
  max-height: 85vh;
  position: relative;
  animation: fadeIn 0.4s ease;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 1.6em;
  cursor: pointer;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--accent);
}

/* ==============================
   💬 CHATBOT HARMONISÉ AVEC LE THÈME
============================== */

#chatbot-toggler {
  position: fixed;
  bottom: 70px;
  right: 35px;
  height: 55px;
  width: 55px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

#chatbot-toggler span,
#chatbot-toggler img,
#chatbot-toggler .open-emoji,
#chatbot-toggler .close-emoji {
  font-size: 1.6rem;
  color: #fff;
  position: absolute;
  transition: var(--transition);
}

body.show-chatbot #chatbot-toggler {
  transform: rotate(90deg);
}

body.show-chatbot #chatbot-toggler .open-emoji {
  opacity: 0;
}

body.show-chatbot #chatbot-toggler .close-emoji {
  opacity: 1;
}

/* Chatbot Popup */
.chatbot-popup {
  position: fixed;
  right: 25px;
  bottom: 90px;
  width: 360px;
  background: var(--card-bg);
  color: var(--text-color);
  overflow: hidden;
  border-radius: 15px;
  opacity: 0;
  transform: scale(0.2);
  transform-origin: bottom right;
  pointer-events: none;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

body.show-chatbot .chatbot-popup {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent);
  color: #fff;
  padding: 15px 22px;
}

.chat-header .header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-info .chatbot-logo {
  display: inline-flex;         /* Pour bien centrer l'image */
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #fff;             /* fond blanc circulaire */
  padding: 3px;                 /* léger padding pour l'effet encadré */
  overflow: hidden;             /* cache les débords de l'image */
}

/* Cible directement l'image à l'intérieur */
.header-info .chatbot-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;            /* garde les proportions sans déformation */
  border-radius: 50%;
  display: block;
}

.header-info .logo-text {
  font-size: 1.2rem;
  font-weight: 600;
}

#close-chatbot {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 50%;
}

#close-chatbot:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Chat Body */
.chat-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
  max-height: 450px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.bot-message .bot-avatar {
  display: inline-flex;              /* pour centrer l'image */
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--accent);         /* couleur de fond (utile si logo transparent) */
  overflow: hidden;                  /* empêche le logo de dépasser */
  flex-shrink: 0;                    /* empêche la déformation */
}

/* pour cibler directement l’image à l’intérieur */
.bot-message .bot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;                 /* garde les proportions */
  border-radius: 50%;
  display: block;
}

.message-text {
  padding: 10px 15px;
  border-radius: 13px;
  font-size: 0.95rem;
  max-width: 75%;
  word-break: break-word;
  box-shadow: var(--shadow);
}

.bot-message .message-text {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px 13px 13px 3px;
}

.user-message {
  flex-direction: column;
  align-items: flex-end;
}

.user-message .message-text {
  background: var(--accent);
  color: #fff;
  border-radius: 13px 13px 3px 13px;
}

/* Footer */
.chat-footer {
  background: var(--card-bg);
  padding: 15px 22px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-form {
  display: flex;
  align-items: center;
  background: var(--bg-color);
  border-radius: 32px;
  outline: 1px solid rgba(255, 255, 255, 0.15);
  transition: var(--transition);
}

.chat-form:focus-within {
  outline: 2px solid var(--accent);
}

.message-input {
  border: none;
  outline: none;
  flex: 1;
  height: 45px;
  background: transparent;
  color: var(--text-color);
  font-size: 1rem;
  padding: 10px 15px;
  resize: none;
}

.chat-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-right: 6px;
}

.chat-controls button {
  height: 35px;
  width: 35px;
  border: none;
  background: none;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition);
}

.chat-controls button:hover {
  background: rgba(255, 255, 255, 0.1);
}

#send-message {
  background: var(--accent);
  color: #fff;
  display: none;
}

.message-input:valid ~ .chat-controls #send-message {
  display: block;
}

#send-message:hover {
  background: #0056c7;
}

/* Emoji Picker */
em-emoji-picker {
  position: absolute;
  left: 50%;
  top: -340px;
  transform: translateX(-50%);
  width: 100%;
  max-width: 350px;
  max-height: 330px;
  visibility: hidden;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

body.show-emoji-picker em-emoji-picker {
  visibility: visible;
}

/* Responsive */
@media screen and (max-width: 600px) {
  .chatbot-popup {
    width: 100%;
    right: 0;
    bottom: 0;
    height: 100%;
    border-radius: 0;
  }
  .chat-body {
    max-height: none;
  }
}

.chatbot-popup,
#chatbot-toggler,
em-emoji-picker {
  z-index: 99999 !important;
}

.hero video,
.hero::before {
  z-index: 0 !important;
}


/* Responsive for mobile screen */
@media screen and (max-width: 600px) {
  .chatbot-popup {
    width: 100%;
    right: 0;
    bottom: 0;
    border-radius: 0;
    height: 100%;
  }

  .chat-header .header-info .logo-text {
    font-size: 1.1rem;
  }

  .chat-body {
    height: 100%;
    margin-bottom: 0;
  }

  .chat-body .message .message-text {
    max-width: 85%;
  }

  .chat-footer .chat-form {
    border-radius: 0;
    border-radius: 25px;
  }

  .chat-footer .chat-form .message-input {
    border-radius: 0;
  }

  .chat-footer .chat-form .chat-controls {
    padding-right: 10px;
  }

  .chat-footer .chat-form .chat-controls button {
    height: 40px;
    width: 40px;
  }
} 




/* ==============================
   🦶 FOOTER
============================== */
footer {
  text-align: center;
  padding: 20px;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  color: var(--text-color);
  margin-top: auto;
}

/* ==============================
   ✨ ANIMATIONS
============================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== SOCIAL LINKS (à droite de la vidéo) ===== */
.social-links {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 5;
}

.social-icon {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.social-icon img {
  width: 24px;
  height: 24px;
  filter: invert(1);
  transition: filter 0.3s ease;
}

/* Effets de survol */
.social-icon:hover {
  transform: scale(1.1);
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
}

.social-icon:hover img {
  filter: invert(0);
}

/* Spécifique aux thèmes clairs */
[data-theme="light"] .social-icon {
  background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .social-icon img {
  filter: invert(0);
}

[data-theme="light"] .social-icon:hover {
  background: var(--accent);
}

[data-theme="light"] .social-icon:hover img {
  filter: invert(1);
}

/* Responsive : place les icônes en bas sur mobile */
@media screen and (max-width: 768px) {
  .social-links {
    position: absolute;
    right: 50%;
    bottom: 25px;
    transform: translateX(50%);
    flex-direction: row;
    gap: 15px;
  }
}
