/* Full-page background */
html, body, #root {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: #030712;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Center page */
.login-page-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #030712;
}

/* Root container */
.login-shell {
  display: flex;
  width: 100%;
  max-width: 1180px;
  height: 660px;
  background: radial-gradient(circle at top left, #031b4b, #020617 55%);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Left hero */
.login-hero {
  flex: 1.1;
  position: relative;
}

.login-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 15, 33, 0.88), rgba(10, 15, 33, 0.25));
}

.login-hero-text {
  position: absolute;
  left: 36px;
  bottom: 44px;
  right: 32px;
  color: #e5e7eb;
}

.hero-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #a5b4fc;
  letter-spacing: 0.14em;
}

.hero-title {
  font-size: 1.7rem;
  font-weight: 600;
  margin: 4px 0 6px;
}

.hero-subtitle {
  font-size: 0.88rem;
  color: #cbd5f5;
}

/* Right panel */
.login-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 48px;
}

.login-panel-inner {
  width: 100%;
  max-width: 360px;
  color: #e5e7eb;
}

/* Panel text */
.panel-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: #9ca3af;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.panel-title {
  font-size: 2rem;
  margin: 0;
  font-weight: 700;
}

.panel-subtitle {
  margin: 6px 0 24px;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Form fields */
.form-field {
  margin-bottom: 18px;
}

.field-label {
  font-size: 0.85rem;
  color: #d1d5db;
  margin-bottom: 6px;
}

.field-wrapper {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8),
              0 10px 30px rgba(15, 23, 42, 0.8);
}

.field-icon {
  margin-right: 12px;
  font-size: 1rem;
}

.field-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #e5e7eb;
  font-size: 0.95rem;
}

.field-input::placeholder {
  color: #64748b;
}

/* Button */
.primary-button {
  width: 100%;
  padding: 14px;
  border-radius: 999px;
  background: linear-gradient(to bottom, #111827, #020617);
  border: none;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0,0,0,0.9);
  transition: 0.15s ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(0,0,0,1);
}

/* Error message */
.login-status {
  margin-top: 14px;
  color: #fca5a5;
  font-size: 0.85rem;
}

/* Version number */
.login-version {
  margin-top: 22px;
  color: #475569;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Copyright */
.login-copyright {
  margin-top: 6px;
  color: #475569;
  font-size: 0.68rem;
  text-align: center;
}

/* Mobile responsive */
@media (max-width: 900px) {
  .login-shell {
    flex-direction: column;
    height: auto;
    max-width: 95%;
  }

  .login-hero {
    height: 260px;
  }

  .login-panel {
    padding: 28px 28px 36px;
  }

  .login-panel-inner {
    max-width: 100%;
  }
}
.sidebar {
  width: 280px;
  height: 100vh;
  background: #f7f7f8;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 12px;
}

.user-name {
  font-weight: 600;
  margin-bottom: 8px;
}

.new-chat-btn {
  /* width: 100%;
  padding: 6px;
  font-size: 14px;
  cursor: pointer; */
  background: transparent;
  /* Updated border color */
  border: 1px solid var(--secondary-text); 
  padding: 0.35rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--primary-text);
  font-size: 0.9rem;
  width: 100%; /* Take full width */
  box-sizing: border-box;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  margin-left: 8px;
  width: 250px;
}

.conversation-item {
  cursor: pointer;
  font-size: 14px;
  padding-left: 10px;
  padding-right: 10px;
}

.conversation-item:hover {
  background: #646465;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 999px;
}

.conversation-item.active {
  background: #646465;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 999px;
}

.conversation-title {
  font-weight: 500;
  margin-bottom: 4px;
}

.conversation-preview {
  font-size: 13px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-time {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.empty-state {
  padding: 16px;
  color: #777;
  text-align: center;
}

.sidebar-actions{
    margin-top: auto;
    margin-bottom: 10px;
    padding:0.6rem 0.6rem 0.6rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}/* ROW — alignment only, NO background */
.message-row {
  display: flex;
  width: 100%;
  margin: 10px 0;
  background: transparent; /* 🔑 FIX */
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
}

/* BUBBLE — shape & color only */
.message-bubble {
  position: relative;
  max-width: 65%;
  padding: 12px 16px;
  border-radius: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Assistant bubble */
.message-bubble.assistant {
  background-color: #303134;
  color: #fff;
  /* border-top-left-radius: 4px; */
}

/* User bubble */
.message-bubble.user {
  background-color: #2563eb;
  color: #fff;
  border-top-right-radius: 4px;
}

/* Content */
.message-content {
  font-size: 14px;
}

/* ✏️ Edit button */
.edit-button {
  position: absolute;
  bottom: -18px;
  right: -12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
  opacity: 1.0;
  transition: opacity 0.2s ease;
}

.message-bubble.user:hover .edit-button {
  opacity: 0.6;
}

.message-bubble.user:hover .edit-button:hover {
  opacity: 1;
}

.message.tool {
  opacity: 0.6;
  font-style: italic;
}

:root {
    --bg-color: #181818;
    --sidebar-bg: #202124;
    --primary-text: #e8eaed;
    --secondary-text: #9aa0a6;
    --accent-color: #1a73e8;
    /* --user-bg: #1a73e8; */
    /* --assistant-bg: #303134; */
    --input-bg: #202124;
    --border-radius: 12px;
    --max-width: 1200px;
    --shadow: rgba(0, 0, 0, .4);
}
html,
body,
#root {
  height: 100%;
  margin: 0;
  background: var(--bg-color);
}

.page {
  display: flex;
  height: 100vh;
  width: 100%;
  background: var(--bg-color);
  color: var(--primary-text);
  font-family: Arial, sans-serif;
}

/* ---------------------- */
/* SIDEBAR */
/* ---------------------- */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  /* Updated border color */
  border-right: 1px solid var(--assistant-bg);

  display: flex;
  flex-direction: column;

  height: 100vh;
  /* Retained for flexible children alignment */
  align-items: flex-start;
  justify-content: flex-start;

  transition: width 0.25s ease-in-out, padding 0.25s ease;
}

.sidebar.collapsed {
  width: 75px;
}

/* NEW: Sidebar Header container (for logo and toggle button) */
.sidebar-header {
  width: 100%;
  display: flex;
  justify-content: space-between; /* Pushes logo left and button right (default open state) */
  align-items: center;
  /* padding: 1.5rem 1.5rem 1rem 1.5rem; Padding for the top section (default open state) */
  flex-shrink: 0;
  box-sizing: border-box;
}

.sidebar.collapsed .sidebar-header {
  /* When collapsed, remove horizontal padding */
  padding-left: 0;
  padding-right: 0;
  
  /* Center the content (the button will be the only visible item) */
  justify-content: center;
}

/* Logo styling updated for dark theme and new layout */
.sidebar-header .logo {
  height: 50px;
  width: 250px;
  /* padding-left: 25px;
  padding-right: 25px; */
  /* filter: invert(1); CORRECTED: Ensure logo is visible on dark background */
  transition: opacity 0.25s ease, width 0.25s ease, margin 0.25s ease;
}

.sidebar.collapsed .sidebar-header .logo {
  opacity: 0;
  /* Make the logo take up no space in the flex container so the button can center */
  width: 0;
  margin: 0;
  padding-left:0px;
}

/* Bottom area */
.sidebar-bottom {
  margin-top: auto;
  padding: 0 1.5rem 1rem 1.5rem; /* Added horizontal padding (default open state) */
  /* display: flex; */
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%; /* Take full width of sidebar */
  box-sizing: border-box;
}

.sidebar.collapsed .sidebar-bottom {
  /* Remove horizontal padding when collapsed, as content is centered */
  padding-left: 0;
  padding-right: 0;
}

/* Hide realName when collapsed */
.sidebar.collapsed .pill {
  display: none;
}

/* Logout button */
.logout-btn {
  background: transparent;
  /* Updated border color */
  border: 1px solid var(--secondary-text); 
  padding: 0.35rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--primary-text);
  font-size: 0.9rem;
  width: 100%; /* Take full width */
  box-sizing: border-box;
}

/* Logout icon-only mode */
.sidebar.collapsed .logout-btn {
  font-size: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto; 
  margin-right: auto;
}

.sidebar.collapsed .logout-btn::after {
  content: "⎋";
  font-size: 1.3rem;
  color: var(--primary-text);
}

/* ---------------------- */
/* Chat container */
/* ---------------------- */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: 0;
  max-width: none;
  /* Reduced margin-left to make sidebar collapse look better */
  margin-left: 0;
}

.chat-header {
  flex-shrink: 0;
  background: var(--header-bg);
  /* Updated border color */
  border-bottom: 1px solid var(--assistant-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* padding: 0.5rem; Added padding to header */
  background: #202124;
}

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

.pill {
  font-size: 0.85rem;
  color: var(--secondary-text);
  text-align: center;
}

/* Chat messages */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  max-width: 70%;
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: 0 1px 3px var(--shadow);
}

.assistant {
  background: var(--assistant-bg);
  align-self: flex-start;
}

.user {
  background: var(--user-bg);
  color: white;
  align-self: flex-end;
}

/* Input area */
.input-area {
  flex-shrink: 0;
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--input-bg);
  /* Updated border color */
  border-top: 1px solid var(--assistant-bg);
}

.input-area textarea {
  flex: 1;
  resize: none;
  /* Updated background and border color */
  background: var(--header-bg); /* Use header-bg for input */
  border: 1px solid var(--secondary-text);
  border-radius: var(--border-radius);
  padding: 1rem;
  color: var(--primary-text);
}

.input-area button {
  height: 3.5rem;
  padding: 0 1.25rem;
  background: var(--accent-color);
  border: none;
  border-radius: var(--border-radius);
  color: white;
  cursor: pointer;
}

/* Small pill buttons */
.btn-small {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  /* Updated border color */
  border: 1px solid var(--secondary-text);
  color: var(--primary-text);
}

/* ---------------------- */
/* Sidebar Toggle Button */
/* ---------------------- */

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;

  /* No white/glow outline */
  outline: none !important;
  box-shadow: none !important;

  /* Remove mobile tap blue highlight */
  -webkit-tap-highlight-color: transparent;

  /* Shape + center */
  width: 44px;
  height: 44px;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: background 0.2s ease;
}

/* Hover effect */
.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Remove outline entirely */
.sidebar-toggle-btn:focus,
.sidebar-toggle-btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Toggle icon */
.sidebar-toggle-icon {
  width: 28px;
  height: 28px;
  transition: transform 0.25s ease;
  display: block;
  
  /* Invert icon color for dark background */
  filter: invert(1);
}

/* Rotate when collapsed */
.sidebar.collapsed .sidebar-toggle-icon {
  transform: rotate(90deg);
}

/* Remove focus/outline from <img> */
.sidebar-toggle-btn img {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  display: block;
  margin: 0 auto;
}

.accuracy-toggle {
  font-size: 0.85rem;
  color: #ccc;
  margin-bottom: 6px;
}

.accuracy-toggle input {
  margin-right: 6px;
}
:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
}
