/* =====================================================
   MAHADEV AI — Chat Interface Styles
   ===================================================== */

/* FLOATING BUTTON */
.mahadev-fab {
  position: fixed;
  bottom: 90px;
  left: 22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a2e, #ff6600);
  border: none;
  cursor: pointer;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255, 102, 0, 0.45);
  transition: transform 0.3s, box-shadow 0.3s;
  animation: fab-pulse 3s infinite;
}

.mahadev-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 28px rgba(255, 102, 0, 0.65);
}

.mahadev-fab img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.mahadev-fab-emoji {
  font-size: 26px;
  line-height: 1;
}

@keyframes fab-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(255, 102, 0, 0.45); }
  50%       { box-shadow: 0 4px 32px rgba(255, 102, 0, 0.75); }
}

/* FAB TOOLTIP */
.mahadev-fab-tooltip {
  position: fixed;
  bottom: 104px;
  left: 86px;
  background: #1a1a2e;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  font-family: 'Poppins', sans-serif;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9989;
}

.mahadev-fab:hover + .mahadev-fab-tooltip,
.mahadev-fab-tooltip.show {
  opacity: 1;
  transform: translateX(0);
}

/* CHAT WINDOW OVERLAY */
.mahadev-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9991;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.mahadev-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* CHAT WINDOW */
.mahadev-chat {
  position: fixed;
  bottom: 90px;
  left: 22px;
  width: 360px;
  height: 560px;
  max-height: 80vh;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  z-index: 9992;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              opacity 0.3s ease;
  transform-origin: bottom left;
}

.mahadev-chat.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 420px) {
  .mahadev-chat {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 80px;
    height: 78vh;
    border-radius: 18px;
  }
  .mahadev-fab {
    left: 16px;
    bottom: 84px;
  }
}

/* CHAT HEADER */
.mahadev-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 60%, #533483 100%);
  padding: 16px 18px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  flex-shrink: 0;
}

.mahadev-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,153,51,0.6), transparent);
}

.mahadev-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9933, #ff6600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255,153,51,0.3);
  animation: avatar-glow 2.5s infinite;
}

@keyframes avatar-glow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,153,51,0.3); }
  50%       { box-shadow: 0 0 0 5px rgba(255,153,51,0.5); }
}

.mahadev-header-info { flex: 1; }

.mahadev-header-name {
  font-size: 15px;
  font-weight: 700;
  color: white;
  font-family: 'Poppins', sans-serif;
  line-height: 1.2;
}

.mahadev-header-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-family: 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.mahadev-status-dot {
  width: 7px;
  height: 7px;
  background: #4caf50;
  border-radius: 50%;
  animation: blink-dot 2s infinite;
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.mahadev-close {
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
  font-family: 'Poppins', sans-serif;
}

.mahadev-close:hover { background: rgba(255,255,255,0.25); }

/* MESSAGES AREA */
.mahadev-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9ff;
  scroll-behavior: smooth;
}

.mahadev-messages::-webkit-scrollbar { width: 4px; }
.mahadev-messages::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 10px;
}

/* MESSAGE BUBBLES */
.mahadev-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: msg-in 0.3s ease both;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mahadev-msg.user { flex-direction: row-reverse; }

.mahadev-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9933, #ff6600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.mahadev-msg-avatar.user-av {
  background: linear-gradient(135deg, #667eea, #764ba2);
  font-size: 11px;
  font-weight: 700;
  color: white;
  font-family: 'Poppins', sans-serif;
}

.mahadev-bubble {
  max-width: 76%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.6;
  font-family: 'Poppins', sans-serif;
  word-break: break-word;
}

.mahadev-msg.ai .mahadev-bubble {
  background: white;
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.mahadev-msg.user .mahadev-bubble {
  background: linear-gradient(135deg, #ff9933, #ff6600);
  color: white;
  border-bottom-right-radius: 4px;
}

.mahadev-bubble .welcome-title {
  font-family: 'Tiro Devanagari Sanskrit', serif;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
  line-height: 1.4;
}

.mahadev-bubble .welcome-text {
  font-size: 13px;
  color: #444;
  line-height: 1.7;
}

/* TIMESTAMP */
.mahadev-msg-time {
  font-size: 10px;
  color: #bbb;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  flex-shrink: 0;
  padding-bottom: 2px;
}

/* TYPING INDICATOR */
.mahadev-typing {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: msg-in 0.3s ease both;
}

.typing-bubble {
  background: white;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 5px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ccc;
  animation: typing-bounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.30s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); background: #ccc; }
  30%            { transform: translateY(-6px); background: #ff9933; }
}

/* QUICK SUGGESTIONS */
.mahadev-suggestions {
  padding: 8px 14px 4px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  flex-shrink: 0;
  background: #f8f9ff;
  border-top: 1px solid #f0f0f0;
  scrollbar-width: none;
}
.mahadev-suggestions::-webkit-scrollbar { display: none; }

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  background: white;
  border: 1.5px solid #ff9933;
  color: #ff6600;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: 0.2s;
  flex-shrink: 0;
}

.suggestion-chip:hover {
  background: linear-gradient(90deg, #ff9933, #ff6600);
  color: white;
  border-color: transparent;
}

/* INPUT AREA */
.mahadev-input-area {
  padding: 10px 12px 14px;
  background: white;
  border-top: 1px solid #f0f0f0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.mahadev-input-wrap {
  flex: 1;
  background: #f8f9ff;
  border: 1.5px solid #e8e8e8;
  border-radius: 24px;
  display: flex;
  align-items: flex-end;
  padding: 8px 14px;
  transition: border-color 0.25s;
  gap: 8px;
}

.mahadev-input-wrap:focus-within {
  border-color: #ff9933;
  background: white;
  box-shadow: 0 0 0 3px rgba(255,153,51,0.12);
}

.mahadev-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  font-family: 'Poppins', sans-serif;
  color: #1a1a1a;
  resize: none;
  max-height: 80px;
  line-height: 1.5;
  min-height: 20px;
}

.mahadev-input::placeholder { color: #bbb; }

.mahadev-mic {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  padding: 0;
  font-size: 17px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.mahadev-mic:hover { color: #ff6600; }

.mahadev-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9933, #ff6600);
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(255,102,0,0.35);
}

.mahadev-send:hover {
  transform: scale(1.08);
  box-shadow: 0 5px 16px rgba(255,102,0,0.5);
}

.mahadev-send:active { transform: scale(0.95); }

/* POWERED BY */
.mahadev-footer {
  text-align: center;
  padding: 4px 0 8px;
  font-size: 10px;
  color: #ccc;
  font-family: 'Poppins', sans-serif;
  background: white;
  flex-shrink: 0;
}