/* Assistant and runtime UI styles for Skyline Air (Modulify theme & Slide-over Drawer) */

#agent-app {
  --ns-font: var(--font-app-sans, system-ui, sans-serif);
  --ns-bg: #ffffff;
  --ns-fg: #0b172f;
  --ns-primary: #245fd4;
  --ns-accent: #f7be2b;
  --ns-border: rgba(11, 23, 47, 0.12);
  --ns-panelbg: #f8fafc;
  --ns-msgbg: #f2f7fd;
  --ns-muted: #556987;
  width: 100%;
  font-family: var(--ns-font);
}

/* Chat container inside drawer */
#agent-app.ns-composed-app [data-ns-slot="chat"] {
  height: auto !important;
  min-height: 0 !important;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

#agent-app.ns-composed-app [data-ns-slot="chat"] > .ns-chat {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  flex: 1;
  background: transparent;
  display: flex;
  flex-direction: column;
}

/* Hide raw technical disclosure */
#agent-app .ns-chat > details {
  display: none !important;
}

/* Hide default first generic message since intro card is above */
#agent-app .ns-msgs > .ns-msg.bot:first-child {
  display: none !important;
}

/* Chat messages scroll area */
#agent-app .ns-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#agent-app .ns-msg {
  overflow-wrap: break-word;
  padding: 11px 15px;
  line-height: 1.5;
  font-size: 13.5px;
  max-width: 88%;
}

#agent-app .ns-msg.bot {
  background: var(--ns-msgbg);
  color: var(--ns-fg);
  border: 1px solid rgba(36, 95, 212, 0.12);
  align-self: flex-start;
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 1px 3px rgba(11, 23, 47, 0.04);
}

#agent-app .ns-msg.user {
  background: var(--ns-primary);
  color: #ffffff;
  align-self: flex-end;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 2px 6px rgba(36, 95, 212, 0.22);
}

/* Chat input bar */
#agent-app .ns-inputbar {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 10px 0 !important;
  border-top: 1px solid var(--ns-border) !important;
  background: #ffffff !important;
}

#agent-app .ns-inputbar input {
  flex: 1 !important;
  height: 44px !important;
  padding: 0 16px !important;
  border: 1px solid var(--ns-border) !important;
  border-radius: 9999px !important;
  background: #ffffff !important;
  color: var(--ns-fg) !important;
  font: 14px/1.5 var(--ns-font) !important;
  transition: border-color 150ms ease, box-shadow 150ms ease !important;
}

#agent-app .ns-inputbar input:focus {
  outline: none !important;
  border-color: var(--ns-primary) !important;
  box-shadow: 0 0 0 2px rgba(36, 95, 212, 0.2) !important;
}

/* Hide new chat button in dock */
#agent-app .ns-inputbar #ns-newchat {
  display: none !important;
}

/* Circular blue submit button with arrow up */
#agent-app .ns-inputbar button:not(#ns-newchat) {
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border-radius: 9999px !important;
  background: var(--ns-primary) !important;
  color: transparent !important;
  border: 0 !important;
  cursor: pointer !important;
  position: relative !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 150ms ease, transform 150ms ease !important;
}

#agent-app .ns-inputbar button:not(#ns-newchat)::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='19' x2='12' y2='5'%3E%3C/line%3E%3Cpolyline points='5 12 12 5 19 12'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}

#agent-app .ns-inputbar button:not(#ns-newchat):hover {
  background: #132750 !important;
  transform: scale(1.05) !important;
}

#agent-app .ns-inputbar button:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Modulify-styled consent card in chat */
#agent-app .ns-msg.ns-consent {
  background: #0e1217;
  color: #ffffff;
  border: 1px solid rgba(247, 190, 43, 0.5);
  border-radius: 1rem;
  padding: 14px;
  margin-block: 8px;
  position: relative;
  overflow: hidden;
  max-width: 95%;
}

#agent-app .ns-consent::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background-image: repeating-linear-gradient(-45deg, #f7be2b 0 8px, #0e1217 8px 16px);
}

#agent-app .ns-consent-title {
  font-family: var(--font-app-heading, 'Sora', sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  margin-top: 4px;
}

#agent-app .ns-consent-sub {
  color: rgba(255, 255, 255, 0.68);
}

#agent-app .ns-consent-req {
  color: rgba(255, 255, 255, 0.86);
}

#agent-app .ns-consent-done {
  color: #86efac;
}

#agent-app .ns-consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

#agent-app .ns-consent-actions button {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

#agent-app .ns-consent-actions button:first-child {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

#agent-app .ns-consent-actions button:last-child {
  grid-column: 1 / -1;
  background: #f7be2b;
  color: #0e1217;
  border: none;
}

#agent-app .ns-msgs:has(.ns-consent-actions) > .ns-turn-status {
  display: none;
}

/* Settings slot inside settings tab */
#agent-app.ns-composed-app [data-ns-slot="settings"] {
  border: 1px solid var(--ns-border);
  border-radius: 1rem;
  background: var(--ns-panelbg);
  padding: 16px;
  font-size: 0.875rem;
}
