@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap');

/* Update the CSS variables at the top of widget.css */
:root {
  --color-brand-dark: #0f172a;
  --color-brand-primary: #2d5bff;
  --color-brand-accent: #00d4ff;
  --color-brand-soft: #f1f5f9;

  --primary-gradient: linear-gradient(135deg, var(--color-brand-primary) 0%, #1e40af 100%);
  --widget-bg: #0f172a; /* Explicit fallbacks */
  --widget-text: #f8fafc;
  --widget-border: rgba(255, 255, 255, 0.1);
  --msg-user-bg: var(--color-brand-primary);
  --msg-user-text: #ffffff;
  --msg-bot-bg: #1e293b;
  --msg-bot-text: #f1f5f9;
  --input-bg: #1e293b;
  --input-text: #f8fafc;
  --input-border: #334155;
}

/* Ensure html/body stay transparent while inside iframe */
html, body {
  background-color: transparent !important;
  background: transparent !important;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color-scheme: normal;
}

/* Ensure Chat Container has explicit solid background */
.chat-container {
  position: absolute;
  bottom: 80px;
  right: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 90px);
  background-color: #0f172a !important; /* Explicit Solid Background */
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--widget-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  z-index: 999998;
}

/* Fix registration form container background */
.registration-container {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  height: 100%;
  background-color: #0f172a !important; /* Solid Background */
  color: var(--widget-text);
}

.falcon-chat-wrapper {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  width: 100%;
  height: 100%;
  position: relative;
  box-sizing: border-box;
}

/* Launcher Button */
.chat-launcher {
  position: fixed;
  bottom: 12px;
  right: 12px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(45, 91, 255, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999999;
}

.chat-launcher.pos-bottom-left {
    right: auto;
    left: 12px;
}

.chat-launcher:hover {
    transform: scale(1.06);
  box-shadow: 0 12px 28px rgba(0, 212, 255, 0.4);

}

/* Chat Frame Container */
/* .chat-container {
    position: absolute;
    bottom: 80px;
    right: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 90px);
    background: var(--widget-bg);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--widget-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    z-index: 999998;
} */

.chat-container.pos-bottom-left {
    right: auto;
    left: 10px;
}

/* Header */
.chat-header {
    background: var(--primary-gradient);
    color: var(--header-text);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
  border: 2px solid var(--color-brand-accent);
}

.header-title h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
  letter-spacing: -0.01em;

}

.header-title span {
    font-size: 11px;
  color: var(--color-brand-accent);
  font-weight: 500;

    opacity: 0.85;
}

.close-button {
    background: transparent;
    border: none;
    color: var(--header-text);
    cursor: pointer;
     padding: 4px;
  transition: opacity 0.2s;
}

.close-button:hover {
    opacity: 1;
  color: #ffffff;

}

/* Pre-Chat Form */
/* .registration-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
    height: 100%;
    background: transparent;
    color: var(--widget-text);
} */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
      margin-bottom: 6px;
}

.form-group input {
      padding: 12px 14px;

    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--input-text);
    outline: none;
    font-size: 14px;
  transition: border-color 0.2s;
}
.form-group input:focus {
  border-color: var(--color-brand-accent);
}

.start-chat-btn {
  background: var(--color-brand-primary);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.start-chat-btn:hover {
  background: #224ad8;
}
/* Chat Messages Thread */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.message.user {
    align-self: flex-end;
    background: var(--msg-user-bg);
    color: var(--msg-user-text);
    border-bottom-right-radius: 4px;
}

.message.assistant {
    align-self: flex-start;
    background: var(--msg-bot-bg);
    color: var(--msg-bot-text);
    border-bottom-left-radius: 4px;
}

/* Footer & Input */
.chat-footer {
  padding: 14px;
  border-top: 1px solid var(--widget-border);
  background: var(--color-brand-dark);
}

.input-wrapper {
    display: flex;
    gap: 8px;
}

.input-wrapper input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--input-text);
    outline: none;
  font-size: 14px;

}

.send-button {
  background: var(--color-brand-primary);
  color: white;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.footer-attribution {
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 8px;
}

.footer-attribution a {
    color: var(--color-brand-accent);
    text-decoration: none;
}

[x-cloak] {
    display: none !important;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px;
    background: var(--msg-bot-bg);
    border-radius: 8px;
    width: fit-content;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}
