/* static/css/main.css (Chatbot UI/UX) */

/* 🌟 Root Variables for Theme */
:root {
  --primary-blue: #0055cc;
  --dark-blue: #002a70;
  --light-gray: #f4f4f4;
  --chat-bg: #ffffff;
  --border-radius: 15px;
  --shadow: none;  /* Shadow removed */
}

/* 🟢 Chatbot Floating Bubble - Call-To-Action */
#chatbot-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 80px;
  height: 60px;
  background: 
    url("/static/rps_logo.png") no-repeat center center,
    linear-gradient(135deg, #2c6ecf, #1c4fa1); /* Updated to match header */
  background-size: 60% auto, cover;
  border-radius: 25px 25px 25px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  z-index: 999;
  animation: floatBubble 2.5s infinite ease-in-out;
  box-shadow: 0 4px 10px rgba(44, 110, 207, 0.3); /* Subtle glowing shadow */
}

#chatbot-bubble:hover {
  transform: scale(1.15);
  background: linear-gradient(135deg, #1c4fa1, #12387c); /* Darker hover */
  box-shadow: 0 6px 14px rgba(28, 79, 161, 0.45); /* Glow boost on hover */
}

/* ✨ Floating Effect for Engagement */
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* 🏠 Chatbot UI - Main Container Enhanced (Fixed + Flex Column) */
#chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 350px;
  height: 500px;
  background: #f7f7f7;
  border: 1px solid rgba(245, 245, 245, 0.9);
  border-radius: 0; /* Square corners */
  box-shadow: none;
  display: flex; /* Ensures children stack vertically */
  flex-direction: column;
  overflow: hidden;
  animation: fadeInUp 0.4s ease-in-out;
  z-index: 1000;
  backdrop-filter: blur(4px); /* Slight blur for a modern feel */
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

/* 🔹 Chatbot Header */
#chatbot-header {
  background: linear-gradient(135deg, #3b82f6, #1e3a8a);
  color: white;
  padding: 8px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(44, 110, 207, 0.45);
  background-blend-mode: overlay;
  background-size: 200% 200%;
  animation: headerGlow 6s ease infinite;

  /* 🔹 Remove rounded corners */
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* 🔹 Animated subtle shimmer */
@keyframes headerGlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 🔹 Top row: Logo + Title */
#chatbot-header .header-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

#chatbot-logo {
  height: 50px;
  width: auto;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.4));
}

/* 🔹 Header Text (Inside RPS) - Smaller & Shifted Left */
#chatbot-header .header-top span {
  font-family: 'Roboto', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  margin-left: -5px; /* ⬅️ Shift left */
}

/* 🏆 Chatbot Logo */
#chatbot-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

/* Date display styling */
#chatbot-date {
  font-size: 14px;
  color: #333;
  padding: 5px 20px;
  background: #f7f7f7;
  backdrop-filter: blur(4px);
  text-align: center;
  font-family: 'Roboto', sans-serif;
}

/* ❌ Minimize Button */
/* ❌ Minimize Button - Subtle Style */
#chatbot-minimize {
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 18px;
  top: 8px;
  right: 8px;
  position: absolute;
  background: transparent;
  color: #ffffffcc; /* softer white */
  border-radius: 50%;
  text-align: center;
  cursor: pointer;
  font-weight: normal;
  border: 1px solid transparent;
  z-index: 1002;
  transition: all 0.2s ease-in-out;
}

#chatbot-minimize:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* 📨 Welcome Message - Compact with Blue Edge + Enhancements */
.welcome-message {
  background: #f4f8fc;
  border-left: 4px solid #004494;
  padding: 8px 12px;
  border-radius: 8px;
  color: #2a2a2a;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  animation: fadeInWelcome 0.6s ease-in-out;
  position: relative;
}

/* Welcome Message Link */
.welcome-message a {
  color: #004494;
  font-weight: 600;
  text-decoration: underline;
  font-size: 13px;
}

/* 👋 Fade-in Animation */
@keyframes fadeInWelcome {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 📱 Mobile Responsiveness */
@media (max-width: 480px) {
  .welcome-message {
    font-size: 12px;
    padding: 6px 10px;
    line-height: 1.3;
  }

  .welcome-message a {
    font-size: 12px;
  }
}

/* ❌ Optional Dismiss Button (Hidden by Default) */
.welcome-message .dismiss-btn {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 14px;
  background: none;
  border: none;
  color: #004494;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.welcome-message .dismiss-btn:hover {
  opacity: 1;
}

/* 📜 Chat Messages Area */
#chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--light-gray);
  font-family: Arial, sans-serif;
  scroll-behavior: smooth;
  min-height: 0; /* Fixes flex overflow in Firefox */
}

/* 🎭 Message Styling */
.message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  background: #f9f9f9;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.3s ease-in-out;
  word-wrap: break-word;
  position: relative;
}

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

/* 🧑‍💬 User Messages */
.user-message {
  background: var(--primary-blue);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

/* 🤖 Bot Messages */
.bot-message {
  background: #e3e3e3;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

/* 📝 Chat Input */
#chatbot-input-container {
  display: flex;
  align-items: center;
  padding: 16px;
  border-top: 1px solid #ccc;
  background: #fff;
  flex-shrink: 0;
}

/* Upload (plus) button */
#upload-button {
  background: linear-gradient(135deg, #2c6ecf, #1c4fa1);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  margin-right: 8px;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.3s ease;
}

#upload-button:hover {
  background: linear-gradient(135deg, #1c4fa1, #12387c);
}

/* 🔤 Input Field */
#chatbot-input {
  flex: 1;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s ease;
}

#chatbot-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 5px rgba(0, 85, 204, 0.5);
  outline: none;
}

#chatbot-send {
  background: linear-gradient(135deg, #2c6ecf, #1c4fa1); /* Updated gradient */
  color: white;
  border: none;
  padding: 12px 20px;
  margin-left: 8px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
}

#chatbot-send:hover {
  background: linear-gradient(135deg, #1c4fa1, #12387c); /* Darker hover variant */
  transform: scale(1.1);
}

/* 🔄 Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px;
  font-size: 14px;
  color: #888;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--primary-blue);
  border-radius: 50%;
  animation: typing 1.5s infinite;
}

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

/* 🌍 Mobile Optimization */
@media screen and (max-width: 480px) {
  #chatbot-container {
    width: 95%;
    height: 85%;
    right: 10px;
    bottom: 10px;
  }
  #chatbot-bubble {
    width: 70px;
    height: 50px;
  }
}

/* 💬 Smaller Suggestion Buttons */
.welcome-message.suggestion {
  font-size: 13px;
  padding: 6px 10px;
  margin-top: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.welcome-message.suggestion:hover {
  background: #e6f0fa;
  transform: translateY(-1px);
}
/* 📏 Suggestion Row Layout */
.suggestion-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -4px 0 10px 0;
  padding: 0 4px;
}

/* 💬 Suggestion Chip */
.suggestion-chip {
  background: #e6eefb;
  color: #004494;
  border-left: 3px solid #004494;
  border-radius: 14px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.suggestion-chip:hover {
  background: #d6e4f7;
  transform: scale(1.05);
}
