/* ==========================================================================
   AJSE Private Limited - "Nova" AI Chatbot & Rate Assistant Styling
   Palette: Architectural Navy (#0a2540), Amber Gold (#c5a059), Pure White (#ffffff)
   ========================================================================== */

:root {
  --nova-navy: #0a2540;
  --nova-navy-dark: #06182a;
  --nova-navy-light: #163e68;
  --nova-gold: #c5a059;
  --nova-gold-hover: #b08d44;
  --nova-gold-light: rgba(197, 160, 89, 0.12);
  --nova-blue: #0066de;
  --nova-surface: #ffffff;
  --nova-bg: #f8fafc;
  --nova-border: #e2e8f0;
  --nova-text-main: #0f172a;
  --nova-text-muted: #64748b;
  --nova-green: #22c55e;
  --nova-radius-lg: 18px;
  --nova-radius-md: 12px;
  --nova-radius-sm: 8px;
  --nova-shadow: 0 20px 50px -10px rgba(10, 37, 64, 0.22), 0 10px 20px -5px rgba(0, 0, 0, 0.08);
}

/* Floating Launcher Button */
.nova-launcher {
  position: fixed;
  bottom: 74px;
  right: 18px;
  z-index: 998;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--nova-navy) 0%, var(--nova-navy-dark) 100%);
  color: #ffffff;
  border: 2px solid var(--nova-gold);
  border-radius: 9999px;
  padding: 10px 18px;
  box-shadow: 0 8px 24px rgba(10, 37, 64, 0.35);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nova-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(10, 37, 64, 0.45);
  border-color: #ffd885;
}

.nova-launcher-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--nova-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nova-navy);
  flex-shrink: 0;
  position: relative;
}

.nova-launcher-icon svg {
  width: 15px;
  height: 15px;
}

.nova-pulse-ring {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  background: var(--nova-green);
  border: 2px solid #ffffff;
  border-radius: 50%;
  animation: nova-pulse 2s infinite;
}

@keyframes nova-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.nova-launcher-label {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.nova-launcher-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.nova-launcher-sub {
  font-size: 0.7rem;
  color: var(--nova-gold);
  font-weight: 500;
}

/* Chat Window Modal */
.nova-chat-window {
  position: fixed;
  bottom: 84px;
  right: 18px;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 110px);
  background: var(--nova-surface);
  border: 1px solid rgba(197, 160, 89, 0.3);
  border-radius: var(--nova-radius-lg);
  box-shadow: var(--nova-shadow);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.nova-chat-window.is-open {
  display: flex;
  animation: nova-appear 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes nova-appear {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Window Header */
.nova-header {
  background: linear-gradient(135deg, var(--nova-navy) 0%, #0d3153 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--nova-gold);
}

.nova-header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nova-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--nova-gold);
  color: var(--nova-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nova-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--nova-green);
  border: 2px solid var(--nova-navy);
}

.nova-header-info h4 {
  margin: 0;
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nova-header-badge {
  background: rgba(197, 160, 89, 0.25);
  color: #ffe4a0;
  border: 1px solid rgba(197, 160, 89, 0.4);
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
}

.nova-header-sub {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: #cbd5e1;
}

.nova-header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nova-btn-icon {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: var(--nova-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.nova-btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Quick Topic Pills Bar */
.nova-quick-bar {
  background: #f1f5f9;
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--nova-border);
  scrollbar-width: none;
}

.nova-quick-bar::-webkit-scrollbar {
  display: none;
}

.nova-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--nova-navy);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.nova-chip:hover {
  background: var(--nova-gold-light);
  border-color: var(--nova-gold);
  color: var(--nova-navy);
  transform: translateY(-1px);
}

/* Messages Scrollable Area */
.nova-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
}

.nova-message-row {
  display: flex;
  gap: 8px;
  max-width: 92%;
  animation: nova-fade-in 0.2s ease-out;
}

@keyframes nova-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

.nova-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--nova-navy);
  color: var(--nova-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.nova-bubble {
  padding: 12px 14px;
  border-radius: var(--nova-radius-md);
  font-size: 0.86rem;
  line-height: 1.55;
  word-break: break-word;
  position: relative;
}

.nova-bubble-bot {
  background: #ffffff;
  color: var(--nova-text-main);
  border: 1px solid var(--nova-border);
  border-top-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nova-bubble-user {
  background: linear-gradient(135deg, var(--nova-navy) 0%, #15395f 100%);
  color: #ffffff;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(10, 37, 64, 0.2);
}

.nova-bubble h3 {
  font-size: 0.95rem;
  margin: 0 0 6px;
  color: var(--nova-navy);
  font-weight: 800;
}

.nova-bubble h4 {
  font-size: 0.88rem;
  margin: 8px 0 4px;
  color: var(--nova-navy);
  font-weight: 700;
}

.nova-bubble code {
  background: #f1f5f9;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.8rem;
}

.nova-bubble-time {
  font-size: 0.65rem;
  margin-top: 4px;
  color: var(--nova-text-muted);
  text-align: right;
}

.nova-bubble-user .nova-bubble-time {
  color: rgba(255, 255, 255, 0.7);
}

/* Rate Card Display Inside Chat */
.nova-estimate-card {
  margin-top: 10px;
  background: #f8fafc;
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: var(--nova-radius-sm);
  padding: 12px;
  font-size: 0.82rem;
}

.nova-estimate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: var(--nova-navy);
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.nova-estimate-cost {
  font-size: 1.15rem;
  font-weight: 800;
  color: #059669;
  margin: 4px 0;
}

.nova-estimate-meta {
  color: var(--nova-text-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

/* Action Buttons inside message */
.nova-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.nova-action-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--nova-navy);
  padding: 6px 12px;
  border-radius: var(--nova-radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.nova-action-btn:hover {
  background: var(--nova-navy);
  color: #ffffff;
  border-color: var(--nova-navy);
}

.nova-action-btn.is-primary {
  background: #25d366;
  color: #ffffff;
  border-color: #25d366;
}

.nova-action-btn.is-primary:hover {
  background: #1ebc59;
}

/* Interactive Calculator inside Chat */
.nova-calc-box {
  background: #ffffff;
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: var(--nova-radius-md);
  padding: 12px;
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.nova-calc-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--nova-navy);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nova-calc-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nova-calc-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nova-calc-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--nova-text-muted);
}

.nova-calc-input, .nova-calc-select {
  padding: 6px 10px;
  font-size: 0.82rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--nova-text-main);
  font-family: inherit;
}

.nova-calc-input:focus, .nova-calc-select:focus {
  outline: none;
  border-color: var(--nova-navy);
  background: #ffffff;
}

.nova-calc-submit {
  background: linear-gradient(135deg, var(--nova-navy) 0%, #17426d 100%);
  color: #ffffff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.nova-calc-submit:hover {
  background: var(--nova-navy-dark);
}

/* Typing Indicator */
.nova-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--nova-border);
  border-radius: var(--nova-radius-md);
  width: fit-content;
}

.nova-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--nova-text-muted);
  border-radius: 50%;
  animation: nova-bounce 1.4s infinite ease-in-out both;
}

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

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

/* Chat Input Footer */
.nova-footer {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid var(--nova-border);
}

.nova-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 4px 6px 4px 14px;
  transition: border-color 0.2s;
}

.nova-form:focus-within {
  border-color: var(--nova-navy);
  box-shadow: 0 0 0 2px rgba(10, 37, 64, 0.08);
}

.nova-form.is-locked {
  opacity: 0.6;
  background: #e2e8f0;
  cursor: not-allowed;
}

.nova-quick-bar.is-locked {
  opacity: 0.5;
  pointer-events: none;
}

.nova-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.nova-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 6px 0;
  font-size: 0.86rem;
  color: var(--nova-text-main);
  outline: none;
  font-family: inherit;
}

.nova-send-btn {
  background: var(--nova-navy);
  color: #ffffff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.nova-send-btn:hover {
  background: var(--nova-gold);
  color: var(--nova-navy);
  transform: scale(1.05);
}

.nova-send-btn svg {
  width: 15px;
  height: 15px;
}

.nova-disclaimer {
  margin-top: 6px;
  font-size: 0.65rem;
  color: var(--nova-text-muted);
  text-align: center;
  line-height: 1.3;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .nova-launcher {
    bottom: 68px;
    right: 12px;
    padding: 8px 14px;
  }
  .nova-launcher-sub {
    display: none;
  }
  .nova-chat-window {
    bottom: 12px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    height: calc(100vh - 24px);
    max-height: none;
    border-radius: var(--nova-radius-md);
  }
}
