/* =================
   Base Styles
   ================= */

body {
  font-family: "Outfit", sans-serif;
  background-color: #f5f5f5;
  background: linear-gradient(135deg, #e8f4f0 0%, #f0f0f0 100%);
  color: #333;
  overflow: hidden;
}

/* =================
   Glass Panel (Chat Area)
   ================= */

.glass-panel {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* =================
   Navigation Styles
   ================= */

.nav-module-btn {
  position: relative;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-module-btn:not(.active) {
  opacity: 0.9;
}

.nav-module-btn.active {
  opacity: 1;
  filter: brightness(1.15);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
  border-left: 4px solid rgba(255, 255, 255, 0.8);
  animation: agent-slide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes agent-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(12px); }
}

/* =================
   Bot Avatar Section
   ================= */

.bot-avatar-section {
  transition: all 0.3s ease;
}

.bot-avatar {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bot-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(29, 77, 59, 0.3);
}

.bot-status-indicator {
  animation: pulse-status 2s ease-in-out infinite;
}

@keyframes pulse-status {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* Thinking State Ring Animation */
.bot-thinking-ring {
  pointer-events: none;
}

body.state-thinking .bot-thinking-ring {
  opacity: 1;
  animation: spin-ring 1s linear infinite;
}

@keyframes spin-ring {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* =================
   Message Bubbles
   ================= */

/* User Message (Right side, dark green) */
.message-bubble-user {
  background: #1d4d3b;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 400;
}

/* Agent Message (Left side, light gray) */
.message-bubble-agent {
  background: #f3f4f4;
  border: 1px solid #e0e0e0;
  color: #333;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* =================
   Custom Scrollbar
   ================= */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* =================
   Typing Indicator
   ================= */

.typing-dot {
  animation: typing 1.4s infinite ease-in-out both;
  background-color: #1d4d3b;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* =================
   Markdown Styling
   ================= */

.prose-agent {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #333;
}

.prose-agent h1,
.prose-agent h2,
.prose-agent h3 {
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  color: #1d4d3b;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 0.25rem;
}

.prose-agent h3 {
  font-size: 1.1rem;
  border-bottom: none;
}

.prose-agent p {
  margin-bottom: 0.75rem;
}

.prose-agent ul,
.prose-agent ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  list-style-type: disc;
}

.prose-agent li {
  margin-bottom: 0.4rem;
}

.prose-agent strong {
  font-weight: 700;
  color: #1d4d3b;
  background: rgba(29, 77, 59, 0.1);
  padding: 0 0.2rem;
  border-radius: 0.2rem;
}

.prose-agent table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  background: #ffffff;
  border-radius: 0.5rem;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  table-layout: auto;
}

.prose-agent th,
.prose-agent td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  word-break: break-word;
}

.prose-agent th {
  background: #f3f4f4;
  color: #333;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
}

.prose-agent tr:last-child td {
  border-bottom: none;
}

.prose-agent tr:hover td {
  background: #f9f9f9;
}

.prose-agent code {
  background: #f3f4f4;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas;
  font-size: 0.85em;
  color: #d97706;
}

/* =================
   Image Preview
   ================= */

.image-preview-item {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
}

.image-preview-remove:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* =================
   Utility Classes
   ================= */

.glow-text {
  text-shadow: 0 0 10px rgba(234, 179, 8, 0.5);
}

/* =================
   Tool Floater Animations
   ================= */

.tool-name-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.tool-name-floater {
  position: absolute;
  font-family: 'Courier New', monospace;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

@keyframes float-up {
  0% {
    transform: translateY(0) translateX(0);
  }
  100% {
    transform: translateY(-100vh) translateX(20px);
  }
}

@keyframes float-down {
  0% {
    transform: translateY(0) translateX(0);
  }
  100% {
    transform: translateY(100vh) translateX(-20px);
  }
}

@keyframes float-left {
  0% {
    transform: translateX(0) translateY(0);
  }
  100% {
    transform: translateX(-100vw) translateY(30px);
  }
}

@keyframes float-right {
  0% {
    transform: translateX(0) translateY(0);
  }
  100% {
    transform: translateX(100vw) translateY(-30px);
  }
}

@keyframes float-diagonal {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50vw, -50vh);
  }
}
