/* Style for curved border buttons like send button */

.send-btn-style {
  border-radius: 12px;
  padding: 0.5em 1.2em;
  font-weight: 500;
  background: #fff;
  color: #0c121e;
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 2px rgba(16,24,40,0.04);
  transition: background 0.18s, color 0.18s, border 0.18s;
}

.send-btn-style:hover, .send-btn-style:focus {
  background: #f1f1f1;
  border: 1px solid #f1f1f1;
  color: #0c121e;
}
/* Force transparent background for all common chart/graph containers and elements */
.chart, .graph, .plot, .figure, canvas, svg {
  background: transparent !important;
}
:root {
  /* color-scheme: light; */
  --paper: #f9fafb;
  --paper-2: #f2f4f7;
  --ink: #f1f1f1;
  --ink-muted: #667085;
  --accent: #f04438;
  --accent-2: #175cd3;
  --panel: #ffffff;
  --line: #eaecf0;
  --line-strong: #d0d5dd;
}


* {
  font-family: 'Satoshi', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}

/* html, body {
  color-scheme: light;
} */

body {
  font-family: 'Satoshi', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  /* background: linear-gradient(180deg, #303b57 0%, #0c121e 100%); */
  color: var(--ink-muted);
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: transparent;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
  opacity: 0;
  transition: opacity 250ms ease;
}

body.history-open .sidebar-backdrop,
body.profile-open .sidebar-backdrop {
  display: block;
  opacity: 1;
}

.mobile-only-inline {
  display: none;
}

/* Navbar Buttons in Hero */
.navbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
}

.navbar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.navbar-btn svg {
  width: 18px;
  height: 18px;
}

/* History Dropdown */
.history-dropdown {
  position: fixed;
  top: 70px;
  right: 20px;
  transform: translateY(-10px);
  width: 380px;
  max-height: 70vh;
  background: #1a1f2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  z-index: 999;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 250ms ease, transform 250ms ease;
}

body.history-open .history-dropdown {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.history-header h2 {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  text-align: left;
}

.history-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 150ms ease;
  padding: 0;
  flex-shrink: 0;
}

.history-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.history-close-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  display: block;
}

.history-search {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.history-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #ffffff;
  font-size: 0.9rem;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%239CA3AF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>');
  background-repeat: no-repeat;
  background-position: 14px center;
  transition: all 150ms ease;
}

.history-search input::placeholder {
  color: #6B7280;
}

.history-search input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.05);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%239CA3AF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>');
  background-repeat: no-repeat;
  background-position: 14px center;
}

.history-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 20px;
  max-height: calc(70vh - 180px);
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

* {
  scrollbar-color: #ffffff transparent;
  scrollbar-width: thin;
}

*:hover {
  scrollbar-color: #ffffff transparent !important;
}

*:hover::-webkit-scrollbar-thumb {
  background: #ffffff !important;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #ffffff;
  border-radius: 999px;
}

.chat-item {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: #ffffff;
  transition: all 160ms ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.chat-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

.chat-item.is-active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
}

.chat-item-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: #ffffff;
}

.chat-title-input {
  font: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 2px 6px;
  background: #ffffff;
  color: var(--ink);
}

.chat-title-input:focus {
  outline: none;
  border-color: #f97066;
  box-shadow: 0 0 0 2px rgba(240, 68, 56, 0.12);
}

.chat-item-meta {
  font-size: 0.78rem;
  color: #6B7280;
  margin-top: 3px;
}

.chat-item-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.chat-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-item-edit,
.chat-item-delete {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.1);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 150ms ease;
}

.chat-item-edit {
  color: #D1D5DB;
}

.chat-item-delete {
  color: #F87171;
}

.chat-item:hover .chat-item-delete,
.chat-item-actions:hover .chat-item-delete,
.chat-item-actions:focus-within .chat-item-delete {
  opacity: 1;
  pointer-events: auto;
}

.chat-item:hover .chat-item-edit,
.chat-item-actions:hover .chat-item-edit,
.chat-item-actions:focus-within .chat-item-edit {
  opacity: 1;
  pointer-events: auto;
}

.chat-item-edit:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.chat-item-delete:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.4);
}

.chat-item-edit svg,
.chat-item-delete svg {
  width: 14px;
  height: 14px;
}

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px clamp(16px, 2vw, 32px) 12px;
  background: transparent;
  flex-shrink: 0;
}

.hero .flex.gap-2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hero-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 385;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.hero-sub {
  color: #9CA3AF;
  font-size: 0.89rem;
  max-width: 75ch;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
}

.logout-btn:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
  color: #ffffff;
}

.logout-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* Profile Button */
.profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  cursor: pointer;
  transition: all 150ms ease;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

.profile-btn:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.profile-initial {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

/* Profile Dropdown */
.profile-dropdown {
  position: fixed;
  top: 70px;
  right: 20px;
  transform: translateY(-10px);
  width: 280px;
  max-height: 60vh;
  background: #1a1f2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  z-index: 999;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 250ms ease, transform 250ms ease;
}

body.profile-open .profile-dropdown {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.profile-user-info {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.profile-user-name {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  text-align: left;
}

.profile-menu-actions {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
  width: 100%;
  text-align: left;
}

.profile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.profile-menu-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
}

.profile-logout-btn:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
}

.chat-content-wrapper {
  flex: 1;
  overflow-y: auto;
  background: transparent;
}

.chat-panel {
  background: transparent;
  padding: 20px 20px 24px;
}

.chat-input-area {
  padding: 18px clamp(18px, 4vw, 48px) 28px;
  background: transparent;
  /* border-top: 1px solid var(--line); */
  flex-shrink: 0;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eff8ff;
  color: #175cd3;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Input and button polish aligned to the design-system look */
#msg,
textarea#msg,
.uk-textarea {
  border-radius: 12px;
  min-height: 2.5rem;
  max-height: 2.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-family: 'Martel Sans', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}

#msg:focus,
textarea#msg:focus,
.uk-textarea:focus {
  outline: none;
  border-color: #84caff;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.14);
}

#chat-send-btn,
button#chat-send-btn,
#new-chat-btn,
button#new-chat-btn,
#close-sidebar-btn,
button#close-sidebar-btn,
#open-sidebar-btn,
button#open-sidebar-btn,
.uk-button,
button {
  border-radius: 12px;
  font-family: 'Martel Sans', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}

#new-chat-btn,

button#new-chat-btn {
  width: 87%;
  background: #f1f1f1;
  color: #fff;
  transition: box-shadow 0.26s, transform 0.26s, background 0.34s, color 0.22s;
  position: relative;
  overflow: hidden;
}

button#new-chat-btn::before {
  content: '';
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  z-index: 0;
  background: linear-gradient(270deg, #303B57, #0C121E, #23283A, #1A1C26, #8ACFF9, #303B57);
  background-size: 400% 400%;
  filter: blur(8px) brightness(1.3);
  opacity: 0.85;
  animation: neon-animate 6s linear infinite;
  border-radius: 16px;
  transition: opacity 0.3s;
}

button#new-chat-btn:hover::before {
  opacity: 1;
}

button#new-chat-btn > * {
  position: relative;
  z-index: 1;
}

@keyframes neon-animate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#new-chat-btn:hover,
button#new-chat-btn:hover {
  background: #F1F1F1;
  color: #0C121E;
  transform: scale(1.07);
  box-shadow: 0 4px 18px 0 rgba(44, 62, 80, 0.13), 0 1.5px 4px 0 rgba(44, 62, 80, 0.10);
}

#chat-send-btn,
button#chat-send-btn {
  background: #f1f1f1;
  border: 1px solid #f1f1f1;
  color: #0c121e;
}

#chat-send-btn:hover,
button#chat-send-btn:hover {
  background: #d1d5db;
}



.chat-row-assistant {
  background: transparent;
}

.delete-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
}

.delete-chat-modal.is-open {
  display: flex;
}

.delete-chat-modal-card {
  width: min(440px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: #1a1f2e;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  padding: 24px;
}

.delete-chat-modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
}

.delete-chat-modal-text {
  margin: 8px 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #9CA3AF;
}

.delete-chat-modal-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.delete-chat-modal-actions button {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}

.delete-chat-modal-actions button:not(.delete-chat-confirm-btn) {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.delete-chat-modal-actions button:not(.delete-chat-confirm-btn):hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.delete-chat-confirm-btn,
button.delete-chat-confirm-btn {
  background: #DC2626;
  border: 1px solid #DC2626;
  color: #ffffff;
}

.delete-chat-confirm-btn:hover,
button.delete-chat-confirm-btn:hover {
  background: #B91C1C;
  border-color: #B91C1C;
}

@media (max-width: 920px) {
  .app-shell {
    height: auto;
    min-height: 100dvh;
  }

  .history-dropdown {
    width: calc(100% - 40px);
    max-width: 380px;
    right: 20px;
    top: 60px;
    max-height: 60vh;
  }

  .profile-dropdown {
    width: calc(100% - 40px);
    max-width: 280px;
    right: 20px;
    top: 60px;
    max-height: 50vh;
  }

  .navbar-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .navbar-btn svg {
    width: 16px;
    height: 16px;
  }

  .main-panel {
    height: auto;
    min-height: 100dvh;
  }

  .hero {
    padding: 16px 14px 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .chat-content-wrapper {
    padding: 14px;
  }

  .chat-input-area {
    padding: 12px 14px 22px;
  }

  .hero .flex.gap-2.justify-end {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero .flex.gap-2 {
    gap: 0.5rem;
  }

  .chat-panel {
    padding: 14px 12px 18px;
    border-radius: 12px;
  }

  .delete-chat-modal-card {
    border-radius: 12px;
    padding: 16px;
  }
  
  .history-header {
    padding: 16px 20px 12px;
  }
  
  .history-search {
    padding: 12px 20px;
  }
  
  .history-content {
    padding: 12px 20px;
  }
}
