/* ==============================================================================
   SINEIX AI CHATBOT WIDGET STYLES
   Futuristic Glassmorphic Interface for Gemini Flash 2.5
   ============================================================================== */

/* Floating Launcher Button */
.sineix-chat-launcher {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 99999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.sineix-chat-launcher:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 35px rgba(37, 99, 235, 0.6);
}

.sineix-chat-launcher:active {
  transform: scale(0.96);
}

.sineix-chat-launcher .launcher-icon-chat,
.sineix-chat-launcher .launcher-icon-close {
  position: absolute;
  transition: all 0.25s ease-in-out;
}

.sineix-chat-launcher .launcher-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}

.sineix-chat-launcher.active .launcher-icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

.sineix-chat-launcher.active .launcher-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Pulsing Notification Badge */
.sineix-launcher-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background-color: #10b981;
  border: 2.5px solid #0b0f19;
  border-radius: 50%;
}

.sineix-launcher-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.6);
  animation: sineix-pulse-animation 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes sineix-pulse-animation {
  0% { transform: scale(1); opacity: 0.8; }
  70% { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Chat Modal Container */
.sineix-chat-widget {
  position: fixed;
  bottom: 6.25rem;
  right: 1.75rem;
  width: 410px;
  max-width: calc(100vw - 2.5rem);
  height: 620px;
  max-height: calc(100vh - 8rem);
  background: rgba(17, 24, 39, 0.94);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(37, 99, 235, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: #f8fafc;
}

/* Light Theme Adaptability */
html:not(.dark) .sineix-chat-widget {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.9);
  color: #0f172a;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18), 0 0 30px rgba(37, 99, 235, 0.1);
}

html:not(.dark) .sineix-launcher-badge {
  border-color: #ffffff;
}

.sineix-chat-widget.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.sineix-chat-header {
  padding: 1.15rem 1.25rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(6, 182, 212, 0.15) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

html:not(.dark) .sineix-chat-header {
  border-bottom-color: rgba(226, 232, 240, 0.8);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.9) 0%, rgba(236, 254, 255, 0.9) 100%);
}

.sineix-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sineix-header-avatar {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  position: relative;
}

.sineix-header-details {
  display: flex;
  flex-direction: column;
}

.sineix-header-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sineix-header-title .tag-pill {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.25);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

html:not(.dark) .sineix-header-title .tag-pill {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.sineix-header-status {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

html:not(.dark) .sineix-header-status {
  color: #64748b;
}

.sineix-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.sineix-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sineix-header-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.sineix-header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

html:not(.dark) .sineix-header-btn {
  color: #64748b;
}

html:not(.dark) .sineix-header-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
}

/* Chat Messages Container */
.sineix-chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  scroll-behavior: smooth;
}

.sineix-chat-messages::-webkit-scrollbar {
  width: 5px;
}

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

.sineix-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

html:not(.dark) .sineix-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

/* Message Rows */
.sineix-msg-row {
  display: flex;
  gap: 0.65rem;
  max-width: 92%;
  animation: sineixFadeUp 0.25s ease-out;
}

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

.sineix-msg-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.sineix-msg-row.bot {
  align-self: flex-start;
}

.sineix-msg-avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.sineix-msg-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sineix-msg-row.user .sineix-msg-content-wrapper {
  align-items: flex-end;
}

.sineix-msg-bubble {
  padding: 0.75rem 1rem;
  border-radius: 1.15rem;
  font-size: 0.9rem;
  line-height: 1.55;
  word-break: break-word;
}

.sineix-msg-row.user .sineix-msg-bubble {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-bottom-right-radius: 0.25rem;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

.sineix-msg-row.bot .sineix-msg-bubble {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border-bottom-left-radius: 0.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

html:not(.dark) .sineix-msg-row.bot .sineix-msg-bubble {
  background: #f1f5f9;
  border: 1px solid rgba(226, 232, 240, 0.9);
  color: #1e293b;
}

/* Message Markdown Typography */
.sineix-msg-bubble p {
  margin: 0 0 0.5rem 0;
}

.sineix-msg-bubble p:last-child {
  margin-bottom: 0;
}

.sineix-msg-bubble strong {
  font-weight: 700;
  color: #60a5fa;
}

html:not(.dark) .sineix-msg-row.bot .sineix-msg-bubble strong {
  color: #1d4ed8;
}

.sineix-msg-row.user .sineix-msg-bubble strong {
  color: #ffffff;
}

.sineix-msg-bubble ul, .sineix-msg-bubble ol {
  margin: 0.35rem 0 0.5rem 1.15rem;
  padding: 0;
}

.sineix-msg-bubble li {
  margin-bottom: 0.25rem;
}

.sineix-msg-bubble a {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.sineix-msg-bubble a:hover {
  color: #7dd3fc;
}

html:not(.dark) .sineix-msg-row.bot .sineix-msg-bubble a {
  color: #0284c7;
}

.sineix-msg-bubble code {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.15rem 0.35rem;
  border-radius: 0.3rem;
  font-size: 0.825rem;
  font-family: monospace;
}

.sineix-msg-time {
  font-size: 0.68rem;
  color: #64748b;
  padding: 0 0.25rem;
}

/* Suggestion Pills Section */
.sineix-suggestions-container {
  padding: 0.5rem 1.25rem 0.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sineix-suggestions-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  font-weight: 600;
}

.sineix-suggestions-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: none;
}

.sineix-suggestions-scroll::-webkit-scrollbar {
  display: none;
}

.sineix-suggestion-chip {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sineix-suggestion-chip:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-1px);
}

html:not(.dark) .sineix-suggestion-chip {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

html:not(.dark) .sineix-suggestion-chip:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

/* Typing Indicator */
.sineix-typing-indicator {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.15rem;
  border-bottom-left-radius: 0.25rem;
  width: fit-content;
}

html:not(.dark) .sineix-typing-indicator {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.sineix-typing-dot {
  width: 6px;
  height: 6px;
  background-color: #60a5fa;
  border-radius: 50%;
  animation: sineixTypingAnimation 1.4s infinite ease-in-out both;
}

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

@keyframes sineixTypingAnimation {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Chat Input Bar */
.sineix-chat-input-box {
  padding: 0.85rem 1.25rem 0.65rem 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

html:not(.dark) .sineix-chat-input-box {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

.sineix-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.35rem 0.5rem 0.35rem 1.15rem;
  transition: all 0.2s ease;
}

html:not(.dark) .sineix-input-wrapper {
  background: #ffffff;
  border-color: #cbd5e1;
}

.sineix-input-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.sineix-chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  resize: none;
  height: 24px;
  max-height: 80px;
  line-height: 24px;
}

html:not(.dark) .sineix-chat-input {
  color: #0f172a;
}

.sineix-chat-input::placeholder {
  color: #64748b;
}

.sineix-send-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sineix-send-btn:hover:not(:disabled) {
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.sineix-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Chat Footer Attribution */
.sineix-chat-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  color: #64748b;
  text-align: center;
}

.sineix-chat-footer i {
  color: #3b82f6;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .sineix-chat-widget {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }

  .sineix-chat-launcher {
    bottom: 1.25rem;
    right: 1.25rem;
  }
}

