/* ═══════════════════════════════════════════════════════
   SkyX AI Consultant — Phase 1 widget styles
   Scoped to widget elements; does not override theme :root vars.
   ═══════════════════════════════════════════════════════ */

.skyx-launcher,
.skyx-nudge,
.skyx-panel {
  --bg-base: #030306;
  --bg-card: rgba(255,255,255,0.03);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --text-primary: #f0f0f5;
  --text-secondary: rgba(240,240,245,0.6);
  --text-muted: rgba(240,240,245,0.35);
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --teal: #00cec9;
  --green: #00b894;
  --font: 'Plus Jakarta Sans', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

/* ─── Launcher (closed state) ─── */
.skyx-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}
.skyx-launcher.hidden { opacity: 0; pointer-events: none; transform: scale(0.8) translateY(10px); }
.launcher-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 10px 12px;
  background: rgba(13,13,20,0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-hover);
  border-radius: 100px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(108,92,231,0.1);
  transition: all 0.25s;
}
.skyx-launcher:hover .launcher-pill { border-color: rgba(108,92,231,0.4); transform: translateY(-2px); box-shadow: 0 16px 50px rgba(0,0,0,0.6), 0 0 30px rgba(108,92,231,0.2); }
.launcher-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #020204 url("../images/skyx-icon-x-2026.png") center / 70% auto no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.34), 0 0 14px rgba(34, 211, 238, 0.34);
}
.launcher-avatar::after {
  content: '';
  position: absolute;
  bottom: 1px; right: 1px;
  width: 9px; height: 9px;
  background: var(--green);
  border: 2px solid #0d0d14;
  border-radius: 50%;
}
.launcher-text { display: flex; flex-direction: column; line-height: 1.3; }
.launcher-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.launcher-sub { font-size: 11px; color: var(--text-muted); }

/* ─── Proactive nudge bubble ─── */
.skyx-nudge {
  position: fixed;
  bottom: 86px;
  right: 24px;
  z-index: 999;
  max-width: 280px;
  padding: 14px 16px;
  background: rgba(13,13,20,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-hover);
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none;
}
.skyx-nudge.show { opacity: 1; transform: translateY(0); pointer-events: all; }
.skyx-nudge:hover { border-color: rgba(108,92,231,0.4); }
.nudge-close {
  position: absolute;
  top: -8px; right: -8px;
  width: 22px; height: 22px;
  background: #1a1a24;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ─── Panel (open state) ─── */
.skyx-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1001;
  width: 400px;
  height: 600px;
  max-height: calc(100vh - 48px);
  background: rgba(10,10,16,0.85);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
  border: 1px solid var(--border-hover);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(108,92,231,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  transform-origin: bottom right;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
}
.skyx-panel.open { opacity: 1; transform: scale(1) translateY(0); pointer-events: all; }

/* Header */
.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
}
.panel-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #020204 url("../images/skyx-icon-x-2026.png") center / 70% auto no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0;
  color: #fff;
  position: relative;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.34), 0 0 14px rgba(34, 211, 238, 0.28);
}
.panel-avatar::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 10px; height: 10px;
  background: var(--green);
  border: 2px solid #0d0d14;
  border-radius: 50%;
}
.panel-header-text { flex: 1; line-height: 1.3; }
.panel-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.panel-status { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.panel-status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.panel-actions { display: flex; gap: 4px; }
.panel-btn {
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.panel-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

/* Messages area */
.panel-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.panel-messages::-webkit-scrollbar { width: 6px; }
.panel-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.msg { display: flex; gap: 10px; max-width: 88%; animation: skyxMsgIn 0.4s cubic-bezier(0.16,1,0.3,1); }
@keyframes skyxMsgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.msg:not(.user) .msg-avatar {
  background: #020204 url("../images/skyx-icon-x-2026.png") center / 70% auto no-repeat;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.28);
  font-size: 0;
}
.msg-bubble {
  padding: 11px 14px;
  border-radius: 4px 16px 16px 16px;
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .msg-bubble {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  border-radius: 16px 4px 16px 16px;
}
.msg.user .msg-avatar { background: rgba(255,255,255,0.1); }

/* Typing indicator */
.msg-typing .msg-bubble { display: flex; gap: 4px; padding: 14px; }
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: skyxTyping 1.4s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes skyxTyping { 0%,60%,100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Recommendation card */
.rec-card {
  margin-top: 4px;
  background: linear-gradient(135deg, rgba(108,92,231,0.1), rgba(0,206,201,0.05));
  border: 1px solid rgba(108,92,231,0.25);
  border-radius: 14px;
  padding: 16px;
  width: 100%;
}
.rec-card-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  background: rgba(0,206,201,0.1);
  padding: 3px 8px;
  border-radius: 5px;
  margin-bottom: 10px;
}
.rec-card-name { font-size: 16px; font-weight: 800; margin-bottom: 6px; color: var(--text-primary); }
.rec-card-desc { font-size: 13px; line-height: 1.55; color: var(--text-secondary); margin-bottom: 12px; }
.rec-card-price {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-light);
  padding: 8px 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  margin-bottom: 12px;
}
.rec-card-actions { display: flex; flex-direction: column; gap: 8px; }
.rec-btn {
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: all 0.2s;
  text-align: center;
}
.rec-btn-primary { background: var(--accent); color: #fff; }
.rec-btn-primary:hover { background: #7c6ff0; }
.rec-btn-ghost { background: transparent; border: 1px solid var(--border-hover); color: var(--text-secondary); }
.rec-btn-ghost:hover { color: var(--text-primary); border-color: var(--accent-light); }

/* Quick reply chips */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 4px 56px;
  animation: skyxMsgIn 0.4s;
}
.quick-chip {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.quick-chip:hover { color: var(--text-primary); border-color: var(--accent-light); background: rgba(108,92,231,0.1); transform: translateY(-1px); }

/* Input dock */
.panel-input-dock {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
}
.input-context {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.input-context-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent-light); }
.input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-hover);
  border-radius: 14px;
  padding: 6px 6px 6px 14px;
  transition: border-color 0.2s;
}
.input-row:focus-within { border-color: var(--accent-light); }
.input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  max-height: 90px;
  padding: 7px 0;
}
.input-field::placeholder { color: var(--text-muted); }
.input-send {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.input-send:hover { background: #7c6ff0; transform: scale(1.05); }
.input-send:disabled { opacity: 0.4; cursor: default; transform: none; }
.input-footer {
  text-align: center;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: var(--mono);
}
.input-footer span { color: var(--accent-light); }

/* Lead capture form */
.lead-form {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: 14px;
  padding: 16px;
  width: 100%;
  margin-top: 4px;
}
.lead-form-title { font-size: 13.5px; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.lead-form-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.lead-input {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  margin-bottom: 8px;
  outline: none;
  transition: border-color 0.2s;
}
.lead-input:focus { border-color: var(--accent-light); }
.lead-submit {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  border: none;
  border-radius: 9px;
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  font-family: var(--font);
  margin-top: 4px;
}
.lead-submit:hover { background: #7c6ff0; }
.lead-form-safety { font-size: 10.5px; color: var(--text-muted); text-align: center; margin-top: 10px; line-height: 1.4; }

/* Mobile */
@media (max-width: 480px) {
  .skyx-panel {
    width: 100vw; height: 100vh;
    max-height: 100vh;
    bottom: 0; right: 0;
    border-radius: 0;
  }
  .launcher-text { display: none; }
  .launcher-pill { padding: 12px; }
  .launcher-avatar { width: 44px; height: 44px; }
  .skyx-nudge { right: 16px; bottom: 80px; max-width: calc(100vw - 80px); }
}

/* ─── Phase 1.5 — Hero unified single-column layout ─── */
.skyx-guidance-hero.hero-unified { text-align: center; }
.skyx-guidance-hero.hero-unified .guidance-hero-copy { margin-left: auto; margin-right: auto; text-align: left; }
.guidance-hero-centred { max-width: 700px; margin: 0 auto; text-align: left; }
@media (max-width: 640px) { .guidance-hero-centred { max-width: 100%; } }

.hero-trust-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(240, 240, 245, 0.4);
  margin: 10px 0 14px;
  padding: 0 2px;
}
.htl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00b894;
  flex-shrink: 0;
}

/* ─── Phase 1.5 — Enriched recommendation card ─── */
.rec-process-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.rec-process-chips span {
  padding: 4px 10px;
  background: rgba(108, 92, 231, 0.15);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 100px;
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rec-section { margin-bottom: 12px; }
.rec-section-title {
  font-size: 10.5px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.rec-feature-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.rec-feature-chips span {
  padding: 4px 9px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.rec-departments { font-size: 12.5px; color: var(--text-secondary); margin: 0; line-height: 1.5; }
.rec-addon-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.rec-addon-chips span {
  padding: 3px 8px;
  background: rgba(0, 206, 201, 0.08);
  border: 1px solid rgba(0, 206, 201, 0.2);
  border-radius: 5px;
  font-size: 11px;
  color: var(--teal);
  font-family: var(--mono);
}
