:root {  
  --neon-blue: #00b7eb;  
  --neon-red: #ff4040;  
  --neon-cyan: #00f5d4;  
  --dark-bg: #0a0a1a;  
  --glow-blue: rgba(0, 183, 235, 0.6);  
  --glow-red: rgba(255, 64, 64, 0.6);  
  --glow-cyan: rgba(0, 245, 212, 0.6);  
  --text-light: #e5e5ff;  
  --glass-bg: rgba(255, 255, 255, 0.05);  
  --glass-border: rgba(255, 255, 255, 0.2);  
}  

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

body {  
  font-family: 'Inter', sans-serif;  
  background: var(--dark-bg);  
  min-height: 100vh;  
  display: flex;  
  justify-content: center;  
  align-items: center;  
  padding: 15px;  
  color: var(--text-light);  
  position: relative;  
  overflow: hidden;  
}  

canvas#stars {  
  position: fixed;  
  top: 0;  
  left: 0;  
  z-index: 0;  
  pointer-events: none;  
  opacity: 0.5;  
  animation: starTwinkle 5s infinite alternate;  
}  

@keyframes starTwinkle {  
  0%, 100% { opacity: 0.5; }  
  50% { opacity: 0.7; }  
}  

/* === Chat Container === */  
.chat-container {  
  width: 100%;  
  max-width: 900px;  
  height: 90vh;  
  background: var(--glass-bg);  
  border-radius: 30px;  
  box-shadow: 0 0 30px var(--glow-blue), 0 0 15px var(--glow-cyan);  
  display: flex;  
  flex-direction: column;  
  overflow: hidden;  
  position: relative;  
  z-index: 1;  
  border: 1px solid var(--glass-border);  
  transition: box-shadow 0.5s ease;  
}  

.chat-container:hover {  
  box-shadow: 0 0 40px var(--glow-blue), 0 0 25px var(--glow-cyan);  
}  

.chat-header {  
  background: linear-gradient(90deg, var(--neon-blue), #0284c7);  
  color: var(--text-light);  
  padding: 12px 15px;  
  text-align: center;  
  font-size: 24px;  
  font-weight: 600;  
  letter-spacing: 2px;  
  border-bottom: 1px solid var(--glass-border);  
  box-shadow: 0 0 15px var(--glow-blue);  
  display: flex;  
  justify-content: center;  
  align-items: center;  
}  

/* === Chat Messages === */  
.chat-messages {  
  flex: 1;  
  padding: 20px;  
  overflow-y: auto;  
  display: flex;  
  flex-direction: column;  
  gap: 12px;  
  background: transparent;  
  scrollbar-width: none;  
}  

.chat-messages::-webkit-scrollbar {  
  display: none;  
}  

/* === Message === */  
.message-container {  
  display: flex;  
  flex-direction: column;  
  max-width: 100%;  
  position: relative; /* Untuk posisi relatif bulat kecil */  
  opacity: 0;  
  animation: fadeIn 0.5s ease forwards;  
}  

@keyframes fadeIn {  
  0% { opacity: 0; transform: translateY(10px); }  
  100% { opacity: 1; transform: translateY(0); }  
}  

.message {  
  padding: 12px 20px;  
  border-radius: 25px;  
  max-width: 75%;  
  line-height: 1.6;  
  word-wrap: break-word;  
  position: relative;  
  border: 1px solid var(--glass-border);  
  background: rgba(255, 255, 255, 0.05);  
  transition: transform 0.3s ease, box-shadow 0.3s ease;  
}  

.message:hover {  
  transform: scale(1.02);  
  box-shadow: 0 0 20px var(--glow-cyan);  
}  

/* === User Message === */  
.user-message {  
  background: linear-gradient(135deg, var(--neon-red), #dc2626);  
  color: var(--text-light);  
  align-self: flex-end;  
  border-bottom-right-radius: 25px;  
  box-shadow: 0 0 15px var(--glow-red);  
  position: relative;  
  padding: 12px 20px;  
}  

.user-message::before,
.user-message::after {  
  content: '';  
  position: absolute;  
  left: -12px; /* Posisi tetap di kiri */  
  bottom: 8px; /* Dekat waktu, disesuaikan dengan padding */  
  width: 6px;  
  height: 6px;  
  background: var(--neon-red);  
  border-radius: 50%;  
  box-shadow: 0 0 5px var(--glow-red);  
  animation: blink 1.5s ease-in-out infinite;  
}  

.user-message::before {  
  bottom: 16px; /* Sedikit di atas ::after */  
}  

.user-message::after {  
  bottom: 8px; /* Dekat waktu */  
  animation-delay: 0.3s;  
}  

/* === Bot Message === */  
.bot-message {  
  background: linear-gradient(135deg, var(--neon-blue), #0284c7);  
  color: var(--text-light);  
  align-self: flex-start;  
  border-bottom-left-radius: 25px;  
  box-shadow: 0 0 15px var(--glow-blue);  
  position: relative;  
  padding: 12px 20px;  
}  

.bot-message::before,
.bot-message::after {  
  content: '';  
  position: absolute;  
  right: -12px; /* Posisi tetap di kanan */  
  bottom: 8px; /* Dekat waktu, disesuaikan dengan padding */  
  width: 6px;  
  height: 6px;  
  background: var(--neon-blue);  
  border-radius: 50%;  
  box-shadow: 0 0 5px var(--glow-blue);  
  animation: blink 1.5s ease-in-out infinite;  
}  

.bot-message::before {  
  bottom: 16px; /* Sedikit di atas ::after */  
}  

.bot-message::after {  
  bottom: 8px; /* Dekat waktu */  
  animation-delay: 0.3s;  
}  

/* === Animasi Tambahan === */  
@keyframes blink {  
  0%, 100% { opacity: 0.2; }  
  50% { opacity: 1; }  
}  

@keyframes neonRotate {  
  0% { background-position: 0% 50%; }  
  50% { background-position: 400% 50%; }  
  100% { background-position: 0% 50%; }  
}  

.bot-message p {  
  margin: 0;  
}  

.academic-paragraph {  
  margin-bottom: 0.8em !important;  
  line-height: 1.8;  
  font-size: 15px;  
  letter-spacing: 0.3px;  
}  

.message-time {  
  font-size: 10px;  
  margin-top: 6px;  
  opacity: 0.7;  
  color: var(--neon-cyan);  
  letter-spacing: 0.8px;  
  transition: opacity 0.3s ease;  
}  

.message-container:hover .message-time {  
  opacity: 1;  
}  

.user-message + .message-time {  
  align-self: flex-end;  
}  

.bot-message + .message-time {  
  align-self: flex-start;  
}  

/* === Input === */  
.chat-input-container {  
  padding: 15px;  
  display: flex;  
  background: var(--glass-bg);  
  border-top: 1px solid var(--glass-border);  
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.4);  
}  

#user-input {  
  flex: 1;  
  padding: 10px 20px;  
  border: none;  
  border-radius: 30px;  
  font-size: 15px;  
  outline: none;  
  background: rgba(255, 64, 64, 0.1);  
  color: var(--text-light);  
  box-shadow: 0 0 15px var(--glow-red);  
  transition: box-shadow 0.3s ease, background 0.3s ease;  
}  

#user-input:focus {  
  background: rgba(255, 64, 64, 0.15);  
  box-shadow: 0 0 20px var(--glow-red);  
}  

#send-button {  
  background: linear-gradient(135deg, var(--neon-cyan), #00a884);  
  color: var(--text-light);  
  border: none;  
  padding: 0 25px;  
  margin-left: 10px;  
  border-radius: 30px;  
  cursor: pointer;  
  font-weight: 600;  
  font-size: 15px;  
  box-shadow: 0 0 15px var(--glow-cyan);  
  transition: box-shadow 0.3s ease, transform 0.2s ease;  
}  

#send-button:hover {  
  box-shadow: 0 0 25px var(--glow-cyan);  
  transform: translateY(-2px);  
}  

#send-button:active {  
  transform: scale(0.95);  
}  

/* === Typing Indicator === */  
.typing-indicator {  
  display: flex;  
  gap: 5px;  
  padding: 10px 15px;  
  background: linear-gradient(135deg, var(--neon-blue), #0284c7);  
  border-radius: 25px;  
  align-self: flex-start;  
  box-shadow: 0 0 15px var(--glow-blue);  
  animation: pulse 1.5s infinite;  
}  

.typing-dot {  
  width: 6px;  
  height: 6px;  
  background: var(--neon-cyan);  
  border-radius: 50%;  
  animation: typing 1.2s infinite ease-in-out;  
}  

.typing-dot:nth-child(2) { animation-delay: 0.2s; }  
.typing-dot:nth-child(3) { animation-delay: 0.4s; }  

@keyframes pulse {  
  0%, 100% { box-shadow: 0 0 15px var(--glow-blue); }  
  50% { box-shadow: 0 0 25px var(--glow-blue); }  
}  

@keyframes typing {  
  0%, 60%, 100% { transform: scale(1); }  
  30% { transform: scale(1.4); }  
}  

/* === Mode Toggle === */  
.mode-container {  
  position: absolute;  
  top: 10px;  
  right: 15px;  
  z-index: 2;  
  display: flex;  
  align-items: center;  
}  

.mode-toggle {  
  padding: 8px 15px;  
  border: none;  
  border-radius: 50px;  
  background: linear-gradient(135deg, var(--neon-blue), #0284c7);  
  color: var(--text-light);  
  font-weight: 600;  
  font-size: 15px;  
  cursor: pointer;  
  box-shadow: 0 0 15px var(--glow-blue), 0 0 5px var(--glow-cyan);  
  transition: box-shadow 0.3s ease, transform 0.2s ease;  
  min-width: 60px;  
  display: flex;  
  justify-content: center;  
  align-items: center;  
  position: relative;  
  overflow: hidden;  
}  

.mode-toggle::before {  
  content: '';  
  position: absolute;  
  top: 0; left: 0;  
  width: 100%; height: 100%;  
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent);  
  opacity: 0;  
  transition: opacity 0.3s ease;  
}  

.mode-toggle:hover::before {  
  opacity: 1;  
}  

.mode-toggle:hover {  
  box-shadow: 0 0 25px var(--glow-blue), 0 0 10px var(--glow-cyan);  
  transform: translateY(-2px);  
}  

.mode-toggle:active {  
  transform: scale(0.95);  
}  

/* === Dropdown === */  
.mode-dropdown {  
  display: none;  
  position: absolute;  
  top: 50px;  
  right: 0;  
  background: var(--glass-bg);  
  border-radius: 15px;  
  box-shadow: 0 0 15px var(--glow-blue);  
  padding: 5px 0;  
  min-width: 100px;  
  animation: fadeInDropdown 0.3s ease;  
}  

@keyframes fadeInDropdown {  
  0% { opacity: 0; transform: translateY(-10px); }  
  100% { opacity: 1; transform: translateY(0); }  
}  

.mode-dropdown.active {  
  display: block;  
}  

.mode-option {  
  padding: 10px 20px;  
  border-radius: 15px;  
  background: transparent;  
  color: var(--text-light);  
  font-weight: 600;  
  font-size: 14px;  
  cursor: pointer;  
  width: 100%;  
  text-align: left;  
  transition: background 0.3s ease, transform 0.2s ease;  
}  

.mode-option:hover {  
  background: rgba(0, 183, 235, 0.4);  
  transform: translateX(5px);  
}  

.mode-option.active {  
  background: var(--neon-blue);  
}  

/* === Responsive === */  
@media (max-width: 768px) {  
  .chat-container {  
    height: 95vh;  
    border-radius: 20px;  
    box-shadow: 0 0 20px var(--glow-blue);  
  }  

  .chat-header {  
    font-size: 20px;  
    padding: 10px;  
  }  

  .chat-messages {  
    padding: 12px;  
    gap: 8px;  
  }  

  .message {  
    padding: 10px 15px;  
    font-size: 14px;  
    border-radius: 20px;  
  }  

  .academic-paragraph {  
    font-size: 14px;  
    line-height: 1.6;  
  }  

  #user-input {  
    padding: 8px 15px;  
    font-size: 14px;  
    border-radius: 25px;  
  }  

  #send-button {  
    padding: 0 20px;  
    font-size: 14px;  
    border-radius: 25px;  
  }  

  .mode-container {  
    top: 8px;  
    right: 10px;  
  }  

  .mode-toggle {  
    padding: 6px 12px;  
    font-size: 14px;  
    min-width: 50px;  
  }  

  .mode-dropdown {  
    top: 40px;  
    min-width: 90px;  
  }  

  .mode-option {  
    padding: 8px 15px;  
    font-size: 13px;  
  }  

  .mode-button {  
    padding: 6px 14px;  
    background: rgba(30, 144, 255, 0.1);  
    color: white;  
    border: 1px solid rgba(255, 255, 255, 0.2);  
    border-radius: 10px;  
    font-size: 14px;  
    cursor: pointer;  
    backdrop-filter: blur(4px);  
    box-shadow: 0 0 6px #ff000066, 0 0 12px #ff000044;  
    transition: all 0.2s ease-in-out;  
  }  

  .mode-button:hover {  
    transform: scale(1.05);  
    box-shadow: 0 0 10px #ff0000aa, 0 0 20px #ff0000aa;  
  }  
  /* Container tombol */  
  .button-container {  
    margin: 20px auto;  
    text-align: center;  
  }  

  /* Tombol utama dan submenu */  
  .mode-button {  
    padding: 10px 20px;  
    font-size: 16px;  
    background: rgba(0, 123, 255, 0.2);  
    color: white;  
    border: 1px solid rgba(255, 255, 255, 0.2);  
    border-radius: 12px;  
    backdrop-filter: blur(6px);  
    cursor: pointer;  
    transition: all 0.3s ease;  
  }  
  .mode-button:hover:not(:disabled) {  
    background: rgba(0, 123, 255, 0.4);  
  }  
  .mode-button:disabled {  
    opacity: 0.4;  
    cursor: not-allowed;  
  }  

  /* Modal overlay */  
  .modal-overlay {  
    position: fixed;  
    top: 0;  
    left: 0;  
    width: 100%;  
    height: 100%;  
    background: rgba(30, 30, 30, 0.4);  
    backdrop-filter: blur(5px);  
    display: flex;  
    justify-content: center;  
    align-items: center;  
    z-index: 1000;  
  }  

  /* Modal box */  
  .modal-content {  
    background: rgba(255, 255, 255, 0.07);  
    border: 1px solid rgba(255, 255, 255, 0.15);  
    border-radius: 16px;  
    padding: 20px 30px;  
    text-align: center;  
    color: white;  
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);  
    backdrop-filter: blur(12px);  
    position: relative;  
  }  

  /* Tombol close modal */  
  .close-button {  
    position: absolute;  
    top: 10px;  
    right: 14px;  
    font-size: 20px;  
    cursor: pointer;  
    color: white;  
  }  
  .close-button:hover {  
    color: red;  
  }  
}