:root {
  --primary: #ed0000;
  --secondary: #ed0000;
  --dark: #1a1a2e;
  --light: #f8f9fa;
  --danger: #e63946;
  --success: #2a9d8f;
  --warning: #f4a261;
  --glow: 0 0 15px #ed0000;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--dark);
  color: var(--light);
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  margin-bottom: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: var(--glow);
  animation: pulse 2s ease-out;
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(to right, #fff, #ddd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.chat-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-history {
  min-height: 60vh;
  max-height: 60vh;
  overflow-y: auto;
  padding: 20px;
  border-radius: 10px;
  background-color: rgba(26, 26, 46, 0.7);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  scroll-behavior: smooth;
}

.message {
  margin-bottom: 15px;
  padding: 15px;
  border-radius: 10px;
  max-width: 80%;
  animation: fadeIn 0.3s ease-out;
}

.user-message {
  background-color: rgba(110, 72, 170, 0.3);
  border-left: 4px solid var(--primary);
  margin-left: auto;
}

.bot-message {
  background-color: rgba(26, 26, 46, 0.8);
  border-right: 4px solid var(--secondary);
  margin-right: auto;
}

.message-content {
  line-height: 1.6;
}

.message-time {
  font-size: 0.8rem;
  color: #aaa;
  margin-top: 5px;
  text-align: right;
}

.input-area {
  padding: 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.8), rgba(157, 80, 187, 0.2));
  box-shadow: var(--glow);
}

.file-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

#fileInfo {
  font-size: 0.9rem;
  color: #bbb;
}

.message-input {
  display: flex;
  gap: 10px;
}

textarea {
  flex: 1;
  padding: 15px;
  border-radius: 8px;
  border: none;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--light);
  resize: none;
  outline: none;
  transition: all 0.3s;
}

textarea:focus {
  background-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 10px rgba(110, 72, 170, 0.5);
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.glow-on-hover:hover {
  box-shadow: 0 0 15px rgba(110, 72, 170, 0.7);
}

.glow-box {
  transition: box-shadow 0.3s;
}

.glow-box:hover {
  box-shadow: 0 0 25px rgba(110, 72, 170, 0.9);
}

.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.particles::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 30%, rgba(110, 72, 170, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(157, 80, 187, 0.1) 0%, transparent 50%);
  animation: particleMove 20s linear infinite;
}

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

@keyframes pulse {
  0% { box-shadow: 0 0 15px rgba(110, 72, 170, 0.7); }
  100% { box-shadow: 0 0 25px rgba(110, 72, 170, 0.9); }
}

@keyframes particleMove {
  0% { transform: translate(0, 0); }
  50% { transform: translate(50px, 50px); }
  100% { transform: translate(0, 0); }
}

/* Responsive design */
@media (max-width: 768px) {
  .message {
    max-width: 90%;
  }
  
  .message-input {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  /* Add to existing styles */
  .typing-indicator .message-content {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .typing-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9d50bb;
    display: inline-block;
    animation: typingAnimation 1.4s infinite both;
  }

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

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

  @keyframes typingAnimation {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
  }

  button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  textarea:disabled {
    background-color: rgba(255, 255, 255, 0.05);
  }

  .attachment-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
  }

  #filePreviews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
  }

  .file-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    max-width: 150px;
  }

  .file-preview img {
    max-width: 100%;
    max-height: 100px;
    display: block;
  }

  .file-preview audio {
    width: 150px;
  }

  .file-preview .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
  }

  .typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .typing-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--secondary);
    display: inline-block;
    animation: typingAnimation 1.4s infinite both;
  }

  @keyframes typingAnimation {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
  }

  .message-content img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
  }

  .message-content audio {
    margin-top: 10px;
    width: 100%;
  }

  .btn-voice {
  background: linear-gradient(135deg, #ffd1dc, #ffd1dc);
  color: #ffd1dc;
  padding: 10px 20px;
  transition: all 0.3s;
  }

  .btn-voice.recording {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 107, 107, 0.7);
  }

  .recording-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: #ffd1dc;
  }

  .recording-indicator.hidden {
  display: none;
  }

  .pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffd1dc;
  animation: pulse 1.5s ease-out;
  }

  @keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
  }
}
