/* ===== RESET & BASE ===== */
body.standalone-page * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.chat-launcher *,
.chatbot * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.standalone-page {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f7fb;
  overflow-x: hidden;
}

/* ===== HERO SECTION ===== */
body.standalone-page .hero {
  height: 100vh;
  background: linear-gradient(135deg, #015DA9, #EF7F03);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
}

body.standalone-page .hero-content h1 {
  font-size: 60px;
  font-weight: 700;
  margin-bottom: 20px;
}

body.standalone-page .hero-content p {
  font-size: 20px;
  opacity: 0.9;
  margin-bottom: 30px;
}

body.standalone-page .hero-content button {
  border: none;
  background: white;
  color: #015DA9;
  padding: 15px 40px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

body.standalone-page .hero-content button:hover {
  transform: scale(1.05);
}

/* ===== CHAT LAUNCHER ===== */
.chat-launcher {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 65px;
  height: 65px;
  background: linear-gradient(135deg, #015DA9 0%, #EF7F03 100%);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(236, 72, 153, 0.4);
  z-index: 1000;
  transition: all 0.3s ease;
}

.chat-launcher:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(236, 72, 153, 0.5);
}

/* ===== CHATBOT WIDGET ===== */
.chatbot {
  position: fixed;
  right: 30px;
  bottom: 110px;
  width: 380px;
  max-width: calc(100vw - 60px);
  height: 600px;
  max-height: calc(100vh - 140px);
  background: white;
  border-radius: 20px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0,0,0,0.05);
  z-index: 1000;
  animation: chatOpen 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: bottom right;
}

.chatbot.closing {
  animation: chatClose 0.3s ease forwards;
}

@keyframes chatOpen {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes chatClose {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  to {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
}

/* ===== CHAT HEADER ===== */
.chat-header {
  background: #ffffff;
  color: #111827;
  padding: 24px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f3f4f6;
  position: relative;
}

.chat-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(135deg, #015DA9 0%, #EF7F03 100%);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
}

.header-left h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 2px 0;
  color: #111827;
}

.header-left span, .header-left .ai-status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  font-weight: 500;
}

#close-chat {
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  background: #f3f4f6;
  color: #9ca3af;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#close-chat:hover {
  background: #e5e7eb;
  color: #4b5563;
  transform: rotate(90deg);
}

/* ===== CHAT BODY ===== */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  background: #f9fafb;
}

.chat-body::-webkit-scrollbar {
  width: 6px;
}

.chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.chat-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 10px;
}

/* ===== MESSAGES ===== */
.message {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message .avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
}

.message-content {
  background: linear-gradient(135deg, #ffffff 0%, #f4f7fb 100%);
  padding: 14px 18px;
  border-radius: 4px 20px 20px 20px;
  max-width: 80%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border-left: 3px solid #EF7F03;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.message-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.message-content p {
  line-height: 1.6;
  font-size: 14px;
  color: #1f2937;
  margin: 0 0 4px 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-time {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 4px;
}

/* USER MESSAGE */
.message.user {
  justify-content: flex-end;
}

.message.user .message-content {
  background: linear-gradient(135deg, #015DA9 0%, #EF7F03 100%);
  color: white;
  border-radius: 20px 4px 20px 20px;
  border-left: none;
  border-right: none;
  box-shadow: 0 6px 15px rgba(236, 72, 153, 0.2);
}

.message.user .message-content p {
  color: white;
}

.message.user .message-time {
  color: rgba(255, 255, 255, 0.8);
  text-align: left;
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #015DA9;
  animation: typingDot 1.4s infinite;
}

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

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

@keyframes typingDot {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }

  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 46px;
  margin-top: 8px;
}

.quick-btn {
  border: 1.5px solid #015DA9;
  background: white;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  color: #015DA9;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-btn:hover {
  background: linear-gradient(135deg, #015DA9 0%, #EF7F03 100%);
  color: white;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(236, 72, 153, 0.3);
}

/* ===== CHAT FOOTER ===== */
.chat-footer {
  padding: 20px;
  display: flex;
  gap: 12px;
  background: white;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.chat-footer input {
  flex: 1;
  height: 50px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 25px;
  padding: 0 20px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.chat-footer input:focus {
  border-color: #015DA9;
  background: white;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

#send-btn {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #015DA9 0%, #EF7F03 100%);
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

#send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(236, 72, 153, 0.4);
}

#send-btn:active {
  transform: scale(0.95);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  body.standalone-page .hero-content h1 {
    font-size: 40px;
  }
}

@media (max-width: 480px) {
  body.standalone-page .hero-content h1 {
    font-size: 32px;
  }

  .chatbot {
    width: calc(100vw - 40px);
    right: 20px;
    bottom: 90px;
    height: calc(100vh - 180px);
    border-radius: 20px;
  }

  .chat-launcher {
    right: 20px;
    bottom: 20px;
    width: 55px;
    height: 55px;
    font-size: 24px;
  }
}

/* ===== BOT ICON (Glassmorphism 3D) ===== */
.bot-icon {
    position: relative;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.25);
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin: 0 auto;
}

.message .avatar .bot-icon {
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}
.message .avatar .bot-icon::after {
    border-color: #2563eb transparent transparent transparent;
}
.bot-icon::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 8px;
    border-width: 10px 10px 0 0;
    border-style: solid;
    border-color: rgba(255,255,255,0.9) transparent transparent transparent;
}
.bot-eyes {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}
.bot-eye {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff;
    animation: bot-blink 4s infinite;
}
.bot-smile {
    width: 14px;
    height: 5px;
    border: 2.5px solid #fff;
    border-top: 0;
    border-radius: 0 0 12px 12px;
}
@keyframes bot-blink {
    0%, 96%, 98% { transform: scaleY(1); }
    97% { transform: scaleY(0); }
}

/* Override center glow for internal bot */
.center-glow-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #015DA9, #EF7F03);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(181, 108, 252, 0.4), inset 0 4px 10px rgba(255,255,255,0.3), inset 0 -4px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.center-glow-icon:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 15px 35px rgba(181, 108, 252, 0.6), inset 0 4px 10px rgba(255,255,255,0.5), inset 0 -4px 10px rgba(0,0,0,0.2);
}