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

body {
  background: #0a0a0a;
  color: #c8c8c8;
  font-family: 'Courier New', monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  overflow-x: hidden;
  position: relative;
}

#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

.terminal-bar {
  width: 100%;
  max-width: 700px;
  background: #0c0c0c;
  padding: 8px 15px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  border: 1px solid #1a1a1a;
  border-bottom: none;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.terminal-button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-button.close {
  background: #ff5f56;
}

.terminal-button.minimize {
  background: #ffbd2e;
}

.terminal-button.maximize {
  background: #27c93f;
}

.terminal-title {
  flex: 1;
  text-align: center;
  color: #8a8a8a;
  font-size: 14px;
  letter-spacing: 1px;
}

h1 {
  color: #0f0;
  text-shadow: 0 0 5px #0f0;
  margin-bottom: 20px;
  font-size: 1.8rem;
  letter-spacing: 2px;
}

#chatbox {
  width: 100%;
  max-width: 700px;
  height: 65vh;
  border: 1px solid #1a1a1a;
  border-radius: 0 0 8px 8px;
  padding: 15px;
  overflow-y: auto;
  background: #0c0c0c;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.message {
  margin: 10px 0;
  padding: 12px 15px;
  border-radius: 6px;
  max-width: 85%;
  position: relative;
  animation: fadeIn 0.3s ease;
  line-height: 1.5;
}

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

.user {
  background: #151515;
  border-left: 3px solid #0ff;
  align-self: flex-end;
  color: #0ff;
  text-shadow: 0 0 3px rgba(0, 255, 255, 0.5);
}

.bot {
  background: #151515;
  border-left: 3px solid #f0f;
  align-self: flex-start;
  color: #f0f;
  text-shadow: 0 0 3px rgba(255, 0, 255, 0.5);
}

.message-timestamp {
  font-size: 0.7rem;
  color: #555;
  margin-top: 5px;
  text-align: right;
}

.delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.message:hover .delete-btn {
  opacity: 1;
}

#input-area {
  display: flex;
  width: 100%;
  max-width: 700px;
  margin-top: 20px;
  position: relative;
}

input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #1a1a1a;
  border-radius: 20px 0 0 20px;
  outline: none;
  background: #0c0c0c;
  color: #0f0;
  font-family: 'Courier New', monospace;
}

input:focus {
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
}

input::placeholder {
  color: #444;
}

#send-btn {
  padding: 12px 25px;
  background: linear-gradient(to right, #0c0, #080);
  border: none;
  border-radius: 0 20px 20px 0;
  cursor: pointer;
  font-weight: bold;
  color: #000;
  transition: all 0.2s;
}

#send-btn:hover {
  background: linear-gradient(to right, #0f0, #0c0);
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#clear-btn {
  padding: 12px 15px;
  background: linear-gradient(to right, #333, #222);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  color: #ccc;
  margin-left: 10px;
  transition: all 0.2s;
}

#clear-btn:hover {
  background: linear-gradient(to right, #ff3333, #cc0000);
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.typing-indicator {
  display: none;
  color: #f0f;
  font-style: italic;
  margin: 10px 0;
  padding: 0 15px;
}

.typing-indicator span {
  animation: blink 1.5s infinite;
  opacity: 0.6;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@media (max-width: 600px) {
  body {
    padding: 10px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .message {
    max-width: 90%;
    padding: 10px;
  }
  
  #input-area {
    flex-direction: column;
  }
  
  #clear-btn {
    margin-left: 0;
    margin-top: 10px;
    border-radius: 20px;
  }
  
  input, #send-btn {
    border-radius: 20px;
  }
}