:root {
  --accent: #00ff99;
  --accent-secondary: #00ccff;
  --bg: #0a0a0a;
  --chat-bg: #151515;
  --text: #e6e6e6;
  --user-text: #000;
  --glow: 0 0 12px var(--accent), 0 0 24px var(--accent), 0 0 36px rgba(0, 255, 153, 0.3);
  --glow-secondary: 0 0 12px var(--accent-secondary), 0 0 24px var(--accent-secondary);
}

/* Splash Screen Styles */
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-family: 'Orbitron', sans-serif;
  transition: opacity 0.5s ease;
}

.splash-content {
  text-align: center;
}

.LoupFloun-logo {
  font-size: 3.5rem;
  font-weight: 700;
  color: #00ff99;
  text-shadow: 0 0 10px #00ff99, 0 0 20px #00ff99, 0 0 30px #00ff99;
  margin-bottom: 2rem;
  letter-spacing: 3px;
  animation: pulse 2s infinite;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00ff99;
  animation: bounce 1.4s infinite ease-in-out;
  box-shadow: 0 0 10px #00ff99;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Copy Button Styles */
.copy-btn {
  position: absolute;
  bottom: -32px;
  right: 8px;
  background: rgba(0, 255, 153, 0.1);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.message:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: var(--accent);
  color: #000;
  box-shadow: var(--glow);
}

.copy-btn.copied {
  background: var(--accent);
  color: #000;
  opacity: 1;
}

.message {
  position: relative;
  margin-bottom: 16px;
  display: block;
  width: fit-content;
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.5s ease;
  animation: messageSlideIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

body {
  margin: 0;
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, #1a1a1a 100%);
  color: var(--text);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: background 0.8s ease, color 0.8s ease;
}

.layout {
  display: flex;
  width: 95%;
  max-width: 1100px;
  height: 92vh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--glow);
  background: linear-gradient(180deg, #121212 0%, var(--chat-bg) 100%);
  transition: all 0.8s ease;
}

.sidebar {
  width: 280px;
  background: linear-gradient(90deg, #1a1a1a, #2a2a2a);
  padding: 25px;
  box-shadow: var(--glow);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0, 255, 153, 0.2);
  transition: all 0.8s ease;
}

.sidebar h2 {
  margin-top: 0;
  color: #e6e6e6;
  font-size: 20px;
  text-shadow: 0 0 5px #000, var(--glow);
  letter-spacing: 1px;
  transition: all 0.8s ease;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.info-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--accent), var(--accent-secondary));
  border: 2px solid var(--accent);
  color: #000;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow);
  transition: all 0.3s ease;
  padding: 0;
  margin: 0;
}

.info-btn:hover {
  transform: scale(1.15) rotate(15deg);
  box-shadow: var(--glow-secondary);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  padding: 30px 40px;
  border-radius: 16px;
  border: 2px solid var(--accent);
  box-shadow: var(--glow), 0 10px 50px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: 90%;
  position: relative;
  animation: slideDown 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-content h2 {
  color: var(--accent);
  text-shadow: var(--glow);
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 24px;
  text-align: center;
}

.info-details {
  color: var(--text);
  line-height: 2;
}

.info-details p {
  margin: 10px 0;
  font-size: 16px;
}

.info-details strong {
  color: var(--accent);
  text-shadow: 0 0 5px var(--accent);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 32px;
  font-weight: bold;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
}

.close-btn:hover {
  color: #fff;
  text-shadow: var(--glow);
  transform: rotate(90deg);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#chat-list {
  list-style: none;
  padding: 0;
  margin: 25px 0;
  flex: 1;
  overflow-y: auto;
}

#chat-list li {
  padding: 10px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #2a2a2a, #333);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.5s ease;
  color: #e6e6e6;
}

#chat-list li:hover {
  background: linear-gradient(90deg, #333, #444);
  transform: translateX(5px);
}

#chat-list li.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  color: #000;
  box-shadow: var(--glow);
  transition: all 0.5s ease;
}

button {
  padding: 10px;
  margin-bottom: 12px;
  background: linear-gradient(45deg, var(--accent), var(--accent-secondary));
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: all 0.5s ease;
  color: #ffffff;
}

button:hover {
  transform: scale(1.05);
  box-shadow: var(--glow-secondary);
}

#theme-select, #language-select, #mode-select {
  background: linear-gradient(45deg, #444, #555);
  color: #ffffff;
  border: 1px solid var(--accent);
  padding: 6px 8px;
  border-radius: 6px;
  box-shadow: var(--glow);
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  text-shadow: 0 0 2px #000;
  transition: all 0.5s ease;
}

#theme-select option, #language-select option, #mode-select option {
  background: #2a2a2a;
  color: #e6e6e6;
}

#theme-select:hover, #language-select:hover, #mode-select:hover {
  box-shadow: var(--glow-secondary);
}

#mode-select {
  margin-top: auto;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  transition: all 0.8s ease;
}

.header {
  padding: 8px 16px;
  border-bottom: 1px solid rgba(0, 255, 153, 0.2);
  box-shadow: var(--glow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  background: linear-gradient(90deg, #121212, #1a1a1a);
  transition: all 0.8s ease;
}

.header h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 600;
  color: var(--accent);
  text-shadow: var(--glow);
  transition: all 0.8s ease;
}

.header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

#chat-box {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  background: radial-gradient(circle, rgba(0, 255, 153, 0.05) 0%, var(--chat-bg) 70%);
  transition: all 0.8s ease;
  scroll-behavior: smooth;
}

.user {
  background: linear-gradient(90deg, rgba(0, 255, 153, 0.3), rgba(0, 204, 255, 0.3));
  color: var(--user-text);
  margin-left: auto;
  border-bottom-right-radius: 4px;
  text-align: right;
  transition: all 0.5s ease;
  animation: userMessageSlideIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.bot {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(0, 204, 255, 0.1));
  color: var(--text);
  margin-right: auto;
  border-bottom-left-radius: 4px;
  text-align: left;
  transition: all 0.5s ease;
  animation: botMessageSlideIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.message.typing {
  animation: pulse 1.5s infinite, botMessageSlideIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  background: linear-gradient(90deg, rgba(0, 255, 153, 0.2), rgba(0, 204, 255, 0.2));
  transition: all 0.5s ease;
}

.generated-image {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 8px;
  transition: all 0.5s ease;
  animation: imageFadeIn 0.8s ease both;
}

.image-message {
  animation: messageSlideIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.image-caption {
  font-weight: bold;
  margin-bottom: 5px;
  transition: all 0.5s ease;
}

form {
  display: flex;
  padding: 20px;
  border-top: 1px solid rgba(0, 255, 153, 0.2);
  transition: all 0.8s ease;
}

input[type="text"] {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 16px;
  background: linear-gradient(90deg, #555, #666);
  color: #ffffff;
  box-shadow: var(--glow);
  transition: all 0.5s ease;
  text-shadow: 0 0 2px #000;
}

input[type="text"]:focus {
  box-shadow: var(--glow-secondary);
  outline: none;
}

input[type="text"]::placeholder {
  color: #e6e6e6;
  opacity: 1;
}

form button {
  margin-left: 12px;
  padding: 12px 20px;
  background: linear-gradient(45deg, var(--accent), var(--accent-secondary));
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--glow);
  color: #000;
  text-shadow: 0 0 2px #fff;
  transition: all 0.5s ease;
}

form button:hover {
  transform: scale(1.05);
  box-shadow: var(--glow-secondary);
}

@keyframes messageSlideIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes userMessageSlideIn {
  0% {
    opacity: 0;
    transform: translateX(50px) translateY(20px) scale(0.9);
  }
  60% {
    opacity: 0.8;
    transform: translateX(-5px) translateY(0) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

@keyframes botMessageSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-50px) translateY(20px) scale(0.9);
  }
  60% {
    opacity: 0.8;
    transform: translateX(5px) translateY(0) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

@keyframes imageFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(-2deg);
  }
  70% {
    opacity: 0.7;
    transform: scale(1.05) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@media (max-width: 720px) {
  .layout { flex-direction: column; width: 100%; height: 100vh; }
  .sidebar { width: 100%; height: auto; order: 2; padding: 15px; }
  .chat-container { order: 1; height: 100%; }
  #chat-list { display: flex; gap: 10px; overflow-x: auto; }
  #chat-list li { white-space: nowrap; padding: 8px; }
  .message { max-width: 95%; }
  .header-controls { flex-direction: column; gap: 5px; }
  .LoupFloun-logo { font-size: 2.5rem; }
  .sidebar-header { flex-wrap: wrap; }
}