:root {
  --bg-color: #0f0f13;
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --secondary-color: #1e1e24;
  --text-color: #e2e8f0;
  --text-muted: #94a3b8;
  --sent-msg-bg: #3b82f6;
  --recv-msg-bg: #1e293b;
  --glass-bg: rgba(30, 30, 36, 0.7);
  --border-color: rgba(255, 255, 255, 0.1);
  --font-family: "Inter", sans-serif;
}

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

body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-color);
  font-family: var(--font-family);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
}

.app-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    radial-gradient(
      circle at 10% 20%,
      rgba(59, 130, 246, 0.15) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(139, 92, 246, 0.15) 0%,
      transparent 40%
    );
}

nav {
  height: 60px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--primary-color);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ef4444; /* Default offline/searching */
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  transition: all 0.3s ease;
}

.indicator.online {
  background-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

/* Chat container */
.container {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* Scrollbar Styling */
.container::-webkit-scrollbar {
  width: 6px;
}
.container::-webkit-scrollbar-track {
  background: transparent;
}
.container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.system-message {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 10px 0;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  align-self: center;
  border: 1px solid var(--border-color);
}

.mesg {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
  animation: fadeIn 0.2s ease-out;
}

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

.left {
  align-self: flex-start;
  background-color: var(--recv-msg-bg);
  border-bottom-left-radius: 4px;
  color: var(--text-color);
}

.right {
  align-self: flex-end;
  background-color: var(--sent-msg-bg);
  border-bottom-right-radius: 4px;
  color: white;
}

/* Typing Indicator */
.typing-indicator {
  padding: 10px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  height: 40px;
}

.typing-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

.dots {
  display: flex;
  gap: 4px;
}

.dot {
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
  animation-delay: -0.32s;
}
.dot:nth-child(2) {
  animation-delay: -0.16s;
}

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

/* Controls Area */
.controls-area {
  padding: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

form {
  display: flex;
  gap: 10px;
  flex: 1;
  max-width: 700px;
}

input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  color: white;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--primary-color);
}

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

button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s;
}

#sendBtn {
  background-color: var(--primary-color);
  color: white;
}

#sendBtn:hover:not(:disabled) {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

#sendBtn:disabled {
  background-color: var(--secondary-color);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

@media only screen and (max-width: 600px) {
  .mesg {
    max-width: 85%;
  }
  .controls-area {
    padding: 15px;
    flex-direction: column;
    gap: 10px;
  }
  form {
    width: 100%;
  }
  #skipBtn {
    width: 100%;
  }
}
