/* ========================================
   LANDING PAGE CSS ONLY
========================================= */

/* === ROOT & RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  --bg-hover: #333;
  --text-primary: #fff;
  --text-secondary: #a0a0a0;
  --text-tertiary: #666;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --border: #333;
  --border-light: #444;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.5rem;
  --radius-full: 9999px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* === GLOSSY PURPLE BACKGROUND === */
body {
  background: linear-gradient(180deg, #0e0e0e 0%, #0d001a 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  margin: 0;
  font-family: "Inter", sans-serif;
  color: #fff;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    circle at 25% 15%,
    rgba(255, 255, 255, 0.08),
    transparent 70%
  );
  mix-blend-mode: soft-light;
  animation: glossyMove 10s ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes glossyMove {
  from { background-position: 0% 0%; }
  to { background-position: 80% 80%; }
}

/* === UTILITY CLASSES === */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* === LANDING PAGE LAYOUT === */
#landing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* === HEADER === */
.landing-header {
  position: relative;
  width: 100%;
  height: 80px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 1.5rem 2rem;
  gap: 1rem;
}

.landing-header .btn {
  position: absolute;
  top: 25px;
}

#landing-signup-btn {
  right: 120px;
}

#landing-signin-btn {
  right: 30px;
}

/* === BUTTONS === */
.btn {
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--text-secondary);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

/* === BRAND LOGO === */
.brand-logo {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.brand-icon-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.25));
}

.brand-name {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1;
}

/* === MAIN CONTENT === */
.landing-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding-top: 80px; /* Add top padding since logo is now fixed top-left */
  max-width: 56rem;
  margin: 0 auto;
  width: 100%;
}

#landing-page.chat-active .landing-content {
  justify-content: flex-start;
  padding-top: 100px;
}

#landing-page.chat-active .brand-logo {
  margin-bottom: 1.5rem;
}

/* === PROMPT CONTAINER === */
.prompt-container {
  width: 100%;
  max-width: 48rem;
}

#landing-page.chat-active .prompt-container {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 48rem;
  width: 100%;
  z-index: 100;
  padding: 0 2rem;
}

/* === GLASSY TRANSPARENT INPUT WRAPPER === */
.prompt-wrapper {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 40px !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  box-shadow: 0 0 30px rgba(160, 72, 255, 0.2);
  transition: all 0.3s ease;

  /* 🆕 Added padding to give breathing room inside */

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.prompt-wrapper:hover,
.prompt-wrapper:focus-within {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 25px rgba(138, 99, 210, 0.4);
}

/* === INPUT ROW === */
.prompt-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

/* === PROMPT INPUT === */
.prompt-input {
  background: transparent !important;
  border: none;
  color: #fff;
  outline: none;
  font-size: 16px;
  padding: 12px 0 !important;
  resize: none;
  overflow-y: hidden;
  line-height: 1.5;
  max-height: 240px;
  width: 100%;
  box-sizing: border-box;
  align-self: center !important;
  min-height: 48px !important;
  display: flex;
  align-items: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.prompt-input::-webkit-scrollbar {
  display: none;
}

.prompt-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  opacity: 1;
}

/* === PROMPT CONTROLS === */
.prompt-controls {
  display: flex;
  align-items: center;       /* center vertically */
  justify-content: flex-end; /* push buttons to right */
  gap: 0.5rem;
  padding-bottom: 0.25rem;

  /* 🆕 Added small inward offset to prevent edge overlap */
  margin-right: 10px;
  margin-top: 4px;
}

/* === ICON BUTTONS === */
.icon-btn,
.voice-btn {
  flex-shrink: 0;
  align-self: center; /* 🆕 changed from flex-end to center for better vertical align */
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  width: 46px;  /* 🆕 slightly smaller for cleaner fit */
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 10px; /* prevent double-offset */
}

.icon-btn:hover,
.voice-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* === SECOND BUTTON (.send-btn) === */
.send-btn {
  width: 46px;  /* 🆕 consistent with others */
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-right: 0; /* 🆕 keep alignment tight */
}

.send-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.send-btn-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: none;
  transform: translateX(2px);
}

/* === VOICE RECORDING === */
.voice-btn.recording {
  background: #ef4444;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 80%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* === DROPDOWN === */
.dropdown {
  display: inline-flex;
  align-items: flex-end;
  position: relative;
}

.dropdown-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 180px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.attach-dropdown-menu {
  right: auto;
  left: 0;
  bottom: 100%;
  top: auto;
  margin-bottom: 0.5rem;
}

.dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-item:hover {
  background: var(--bg-hover);
}

.dropdown-item:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* === FILE CHIPS === */
.file-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  color: var(--text-primary);
}

.file-chip button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.file-chip button:hover {
  color: var(--text-primary);
}

/* === CHAT CONTAINER (LANDING) === */
.landing-chat-container {
  position: fixed;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  height: calc(100vh - 300px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  padding-bottom: 120px;
  box-sizing: border-box;
  z-index: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.landing-chat-container::-webkit-scrollbar {
  display: none;
}

.landing-chat-container.hidden {
  display: none !important;
}

/* === CHAT MESSAGES === */
.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: fadeIn 0.3s ease;
  margin-bottom: 16px;
  width: 100%;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 70%;
  font-size: 15px;
  line-height: 1.4;
  word-wrap: break-word;
}

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

.chat-message.user .chat-bubble {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.chat-message.ai .chat-bubble {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === SIGNUP PROMPT === */
.signup-prompt-message {
  background: rgba(92, 214, 255, 0.15) !important;
  border: 2px solid rgba(92, 214, 255, 0.4) !important;
  padding: 20px !important;
  text-align: center;
  border-radius: 18px;
  margin-top: 10px;
}

.signup-prompt-message .chat-bubble {
  background: transparent !important;
  border: none !important;
}

signup-prompt-message .message-content {
  background: transparent !important;
  border: none !important;
  max-width: 100% !important;
}

.signup-prompt-btn {
  margin-top: 12px;
  padding: 10px 24px;
  background: #5CD6FF;
  color: #000;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.signup-prompt-btn:hover {
  background: #4AC5EE;
  transform: scale(1.05);
}


/* Assistant messages - align to the left */
.chat-message.assistant {
  justify-content: flex-start;
  flex-direction: row;
}



.message-content {
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 70%;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.chat-message.user .message-content {
  background: rgba(102, 126, 234, 0.2);
  color: #fff;
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 18px 18px 4px 18px;
}

.chat-message.assistant .message-content {
  background: rgba(92, 214, 255, 0.15);
  color: #e0e0e0;
  border: 1px solid rgba(92, 214, 255, 0.3);
  border-radius: 18px 18px 18px 4px;
}

/* === FOOTER === */
.landing-footer {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: #aaa;
}

.landing-footer a {
  color: var(--text-primary);
  text-decoration: none;
}

.landing-footer a:hover {
  text-decoration: underline;
}

/* === ICONS === */
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

/* === HIDE MODE SELECTOR === */
#landing-mode-btn,
.mode-selector {
  display: none !important;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .brand-name {
    font-size: 2rem;
  }

  .landing-header .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  #landing-signup-btn {
    right: 90px;
  }

  #landing-signin-btn {
    right: 20px;
  }

  .prompt-container {
    padding: 0 1rem;
  }

  #landing-page.chat-active .prompt-container {
    padding: 0 1rem;
  }

  .landing-chat-container {
    max-width: 95%;
    padding: 15px;
  }
}


/* Chat avatar (small circular icon to the left/right of messages) */
.chat-message .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}

/* Slightly different backgrounds for user / assistant */
.chat-message.user .avatar { background: rgba(255,255,255,0.12); }
.chat-message.assistant .avatar { background: rgba(92,214,255,0.12); color: #000; }
 #landing-chat-container .chat-message{
    display:flex; align-items:flex-end; gap:10px;
    margin:8px 0; width:100%;
  }
  /* side alignment */
  #landing-chat-container .chat-message.user{ justify-content:flex-start; }
  #landing-chat-container .chat-message.ai{ justify-content:flex-start; }

  /* bubbles */
  #landing-chat-container .chat-bubble{
    max-width:70%; padding:10px 14px; border-radius:18px;
    line-height:1.4; word-break:break-word;
    background:#1e1e1e; color:#fff;
  }
  #landing-chat-container .chat-message.user .chat-bubble{
    background:#0078ff; color:#fff; border-radius:18px 18px 6px 18px;
  }
  #landing-chat-container .chat-message.ai .chat-bubble{
    background:#1f1f1f; color:#fff; border-radius:18px 18px 18px 6px;
  }

  /* AI avatar (left) */
  #landing-chat-container .avatar.ai{
    width:34px; height:34px; border-radius:50%; overflow:hidden; flex:0 0 34px;
    background:#2f2f2f; display:flex; align-items:center; justify-content:center;
  }
  #landing-chat-container .avatar.ai img{
    width:100%; height:100%; object-fit:cover;
  }

  /* ---- Chat alignment & bubbles (landing + app) ---- */
.landing-chat-container,
#chat-container { display:flex; flex-direction:column; gap:14px; }

/* LANDING chat rows */
.chat-message { display:flex; align-items:flex-end; gap:10px; max-width:min(72ch,80%); }
.chat-message.user { margin-left:auto; flex-direction:row-reverse; }   /* right */
.chat-message.ai   { margin-right:auto; }                               /* left */

.chat-message .chat-bubble {
  padding:12px 14px; line-height:1.4; border-radius:16px; word-wrap:break-word;
}
.chat-message.user .chat-bubble {
  background:#1a73e8; color:#fff; border-radius:18px 18px 4px 18px;    /* right tail */
}
.chat-message.ai .chat-bubble {
  background:#2b2b2b; color:#fff; border-radius:18px 18px 18px 4px;    /* left tail */
}

/* small avatar (landing) */
.chat-message .avatar{
  width:28px; height:28px; border-radius:50%; overflow:hidden;
  background:#1d1d1d; display:flex; align-items:center; justify-content:center;
}
.chat-message .avatar img{ width:100%; height:100%; object-fit:cover; }

/* APP chat rows */
#chat-container .message{ display:flex; align-items:flex-end; gap:12px; max-width:min(72ch,70%); }
#chat-container .message.user{ margin-left:auto; flex-direction:row-reverse; }   /* right */
#chat-container .message.assistant,
#chat-container .message.system{ margin-right:auto; }                             /* left */

#chat-container .message-content{
  padding:12px 14px; border-radius:16px; background:#2b2b2b; color:#fff; line-height:1.5;
}
#chat-container .message.user .message-content{
  background:#1a73e8; color:#fff; border-radius:18px 18px 4px 18px;
}
#chat-container .message.assistant .message-content,
#chat-container .message.system .message-content{
  background:#2b2b2b; color:#fff; border-radius:18px 18px 18px 4px;
}

#chat-container .message-avatar{
  width:28px; height:28px; border-radius:50%; overflow:hidden; background:#1d1d1d;
  display:flex; align-items:center; justify-content:center;
}
#chat-container .message-avatar img{ width:100%; height:100%; object-fit:cover; }
/* ===== Force chat side (LANDING) ===== */
#landing-chat-container{display:flex;flex-direction:column;gap:14px;}
#landing-chat-container .chat-message{display:flex;align-items:flex-end;gap:10px;max-width:min(72ch,80%);}
#landing-chat-container .chat-message .chat-bubble{padding:12px 14px;border-radius:16px;color:#fff;line-height:1.4;}

/* user → right  */
#landing-chat-container .chat-message.user{
  align-self:flex-end !important;
  flex-direction:row-reverse;            /* avatar (if any) after bubble */
}
#landing-chat-container .chat-message.user .chat-bubble{
  background:#1a73e8;                    /* blue */
  border-radius:18px 18px 4px 18px;      /* right “tail” */
}

/* ai → left */
#landing-chat-container .chat-message.ai{
  align-self:flex-start !important;
}
#landing-chat-container .chat-message.ai .chat-bubble{
  background:#2b2b2b;
  border-radius:18px 18px 18px 4px;      /* left “tail” */
}

/* small avatar (optional) */
#landing-chat-container .chat-message .avatar{
  width:28px;height:28px;border-radius:50%;overflow:hidden;
  background:#1d1d1d;display:flex;align-items:center;justify-content:center;
}
#landing-chat-container .chat-message .avatar img{width:100%;height:100%;object-fit:cover;}

/* ===== Force chat side (APP) ===== */
#chat-container{display:flex;flex-direction:column;gap:14px;}
#chat-container .message{display:flex;align-items:flex-end;gap:12px;max-width:min(72ch,70%);}
#chat-container .message-content{padding:12px 14px;border-radius:16px;line-height:1.5;color:#fff;}

#chat-container .message.user{
  align-self:flex-end !important;
  flex-direction:row-reverse;
}
#chat-container .message.user .message-content{
  background:#1a73e8;border-radius:18px 18px 4px 18px;
}

#chat-container .message.assistant,
#chat-container .message.system{
  align-self:flex-start !important;
}
#chat-container .message.assistant .message-content,
#chat-container .message.system .message-content{
  background:#2b2b2b;border-radius:18px 18px 18px 4px;
}


/* ------- reset wrappers so they don't paint full-width bars ------- */
.assistant, [data-author="assistant"],
.user, [data-author="user"]{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* ============= ASSISTANT bubble (left) ============= */
.assistant > :not(.avatar):not([class*="avatar"]):not(img):not(svg):not(button):not(.meta):not(.timestamp):not(.icon):not(.badge):not(.status):not(:empty):first-child,
[data-author="assistant"] > :not(.avatar):not([class*="avatar"]):not(img):not(svg):not(button):not(.meta):not(.timestamp):not(.icon):not(.badge):not(.status):not(:empty):first-child{
  display: inline-block !important;
  width: auto !important;
  max-width: 70vw !important;

  /* keep words intact; wrap only when needed */
  white-space: pre-wrap !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: auto !important;

  padding: 14px 18px !important;
  color: #e7e8ea !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  border-radius: 18px !important;
  box-shadow: 0 18px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.05) !important;
  line-height: 1.45 !important;
  font-size: 16px !important;
}
/* ============= USER bubble (right) — PURPLE ============= */
.user > :not(.avatar):not([class*="avatar"]):not(img):not(svg):not(button):not(.meta):not(.timestamp):not(.icon):not(.badge):not(.status):not(:empty):first-child,
[data-author="user"] > :not(.avatar):not([class*="avatar"]):not(img):not(svg):not(button):not(.meta):not(.timestamp):not(.icon):not(.badge):not(.status):not(:empty):first-child{
  display: inline-flex !important;
  align-items: center !important;
  width: auto !important;
  max-width: 60vw !important;

  white-space: pre-wrap !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: auto !important;

  padding: 10px 14px !important;
  /* purple gradient instead of orange */
  background: linear-gradient(180deg, #c4b5fd, #7c3aed) !important; /* light → deep purple */
  color: #ffffff !important;                                         /* good contrast */
  font-weight: 600 !important;
  border: 1px solid rgba(62, 28, 110, 0.35) !important;              /* subtle purple edge */
  border-radius: 16px !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.50), inset 0 1px 0 rgba(255,255,255,.25) !important;
  line-height: 1.35 !important;
  font-size: 16px !important;
}

/* Make code blocks a positioning context */
pre {
  position: relative;
}

/* Copy button: top-right overlay inside the code box */
.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;

  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(17, 24, 39, 0.96);
  color: #e5e7eb;
  font-size: 12px;
  cursor: pointer;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  transition: background 0.15s ease, border-color 0.15s ease,
              transform 0.1s ease, box-shadow 0.15s ease;
}

/* Hover / “Copied!” states */
.copy-code-btn:hover {
  background: rgba(31, 41, 55, 1);
  border-color: #a855f7;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
}

.copy-code-btn.copied {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border-color: transparent;
  color: #fff;
}

/* Optional: shrink icon a bit */
.copy-code-btn svg {
  width: 14px;
  height: 14px;
}

/* Give extra padding on the right so code doesn’t sit under the button */
pre code {
  padding-right: 70px; /* adjust if needed */
  display: block;
}
/* --- Preview button sits beside your .copy-code-btn --- */
.preview-code-btn{
  position:absolute; top:8px; right:92px; /* leave room for Copy button on the far right */
  background: rgba(255,255,255,0.1);
  border:1px solid rgba(255,255,255,0.2);
  border-radius:6px;
  color:rgba(255,255,255,0.85);
  cursor:pointer;
  padding:6px 10px;
  font-size:12px; font-weight:600;
  display:flex; align-items:center; gap:6px;
  transition: all .2s ease; z-index:10; backdrop-filter: blur(10px);
}
.preview-code-btn:hover{background:rgba(255,255,255,0.2);border-color:rgba(255,255,255,0.4);color:#fff}

/* --- Fullscreen preview overlay (image 2 style) --- */
#code-preview-overlay{
  position:fixed; inset:0; background:#fff; z-index:9000; display:none;
}
#code-preview-overlay.visible{ display:block; }
#code-preview-iframe{
  position:absolute; inset:0; width:100%; height:100%; border:0; background:#fff;
}
/* Red close button like your mock */
#code-preview-close{
  position:fixed; top:12px; right:12px;
  width:40px; height:40px; border:0; border-radius:10px;
  background:#f44336; color:#fff; font-size:20px; line-height:40px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; z-index:9100;
}
#code-preview-close:hover{ filter:brightness(1.05); }
/* === FIX: make chat input expand properly === */
.prompt-area .prompt-input {
  /* let JS control the height; no hard 44px cap */
  min-height: 44px !important;
  max-height: 240px !important;
  overflow-y: hidden !important;   /* hidden until it hits max, then JS flips to auto */
  line-height: 1.5 !important;     /* normal text flow (placeholder will align too) */
  display: block !important;       /* simpler sizing for a textarea */
}

/* optional: keep the right-side control cluster from sitting on top of text on small screens */
@media (max-width: 480px) {
  .prompt-controls { right: 8px; }
}
/* Position toolbar */
.code-toolbar {
  position: absolute;
  top: -10px;
  right: 0;
  display: flex;
  gap: 8px;
  z-index: 10;
}

/* Button shared style (ChatGPT style) */
.code-btn {
  background: #2f2f2f;
  border: 1px solid #4b4b4b;
  color: #e5e5e5;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s ease;
}

.code-btn:hover {
  background: #3c3c3c;
  border-color: #6a6a6a;
}

.preview-btn {
  font-weight: 600;
}

.copy-btn {
  font-weight: 500;
}

/* Ensure the pre block has positioning */
pre {
  position: relative;
  /* padding-top: 45px !important; */
  /* make room for toolbar */
}
/* Modal Background */
/* Full-screen layer */
.preview-modal {
  position: fixed;
  inset: 0;
  /* pure white full page instead of dark overlay */
  background: #ffffff;
  z-index: 9999;

  /* we still use opacity so your .show class fade-in works */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* When JS adds .show */
.preview-modal.show {
  opacity: 1;
  pointer-events: auto;
}

/* Content fills the whole viewport */
.preview-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;

  background: #ffffff;
  border-radius: 0;          /* no rounded corners */
  box-shadow: none;          /* no drop shadow */
  overflow: hidden;
}

@keyframes fadeUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Close Button */
.preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  font-size: 26px;
  font-weight: bold;
  cursor: pointer;
  background: rgba(0,0,0,0.15);
  color: #333;
  transition: 0.2s;
  z-index: 10;
}

.preview-close:hover {
  background: rgba(0,0,0,0.25);
}

/* Iframe */
#previewFrame {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.hidden { display: none !important; }
/* === MESSAGE ACTION BUTTONS (like / dislike / copy / download) === */
/* === MESSAGE ACTION BUTTONS (like / dislike / copy / download) === */
.message-actions {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  margin-top: 8px;
  padding-left: 0;
}

.chat-message.ai .chat-bubble .message-actions .message-action-btn,
.chat-message.assistant .message-actions .message-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;  /* rounded square */
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(17, 24, 39, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  color: #9ca3af;
  font-size: 13px;
  box-shadow: none;

  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    transform 0.08s ease,
    color 0.12s ease;
}

.chat-message.ai .message-actions .message-action-btn:hover,
.chat-message.assistant .message-actions .message-action-btn:hover {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.9);
  color: #e5e7eb;
  transform: translateY(-0.5px);
}

.chat-message.ai .message-actions .message-action-btn.active,
.chat-message.assistant .message-actions .message-action-btn.active {
  background: rgba(129, 140, 248, 0.24);
  border-color: rgba(129, 140, 248, 1);
  color: #e5e7eb;
}

.chat-message.ai .message-actions .message-action-btn svg,
.chat-message.assistant .message-actions .message-action-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}
.message-action-btn {
  font-size: 18px;
}
.message-action-btn svg {
  width: 15px;
  height: 15px;
}
.reaction-btn {
  border: none;
  background: transparent;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e5e7eb;          /* white/gray outline */
}

.reaction-btn svg {
  display: block;
}

/* hover: slightly brighter */
.reaction-btn:hover {
  color: #ffffff;
}

/* optional active state (green for like, red for dislike) */
.reaction-btn[data-action="like"].active {
  color: #22c55e;
}

.reaction-btn[data-action="dislike"].active {
  color: #ef4444;
}
.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Base button: outline icons on dark BG */
.message-action-btn {
  border: none;
  background: transparent;
  padding: 4px;
  cursor: pointer;

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

  color: #e5e7eb;          /* light gray/white icon */
  font-size: 0;            /* we only show the SVG */
}

.message-action-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}

/* hover state */
.message-action-btn:hover {
  color: #ffffff;
}

/* Like/Dislike "selected" state */
.message-action-btn[data-action="like"].active {
  color: #22c55e;          /* green thumb when liked */
}

.message-action-btn[data-action="dislike"].active {
  color: #ef4444;          /* red thumb when disliked */
}

/* One-shot flash for copy / downloads */
.message-action-btn.flash {
  transform: scale(0.9);
  opacity: 0.7;
  transition: transform 0.1s ease, opacity 0.1s ease;
}
/* === BRAND LOGO WITH NEW CHAT === */
/* === BRAND LOGO === */
.brand-logo-wrapper {
  position: fixed;
  top: 20px;
  left: 20px;
  transform: none;
  z-index: 50;
}

.brand-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  cursor: pointer;
}

.brand-icon-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.25));
  transition: opacity 0.2s ease;
}

.brand-name {
  display: none; /* Hide the text name */
}

/* New Chat Button - Hidden by default */
.new-chat-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);

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

  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.new-chat-btn svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

/* Show new chat button on hover, hide logo */
.brand-logo:hover .brand-icon-img,
.brand-logo:hover .brand-name {
  opacity: 0;
}

.brand-logo:hover .new-chat-btn {
  opacity: 1;
  pointer-events: auto;
}

.new-chat-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%) scale(1.1);
}



/* === SAMPLE QUESTION === */
.sample-question {
  width: 100%;
  max-width: 48rem;
  text-align: center;
  margin-bottom: 40px; /* Increased gap between question and input */
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sample-question p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 22px;
  line-height: 1.5;
  margin: 0;
  font-style: auto;

}

/* Hide sample question when chat is active */
#landing-page.chat-active .sample-question {
  display: none;
}
/* Responsive */
@media (max-width: 768px) {
  .brand-name {
    font-size: 2rem;
  }

  .sample-question {
    margin-top: 24px;
    padding: 0 1rem;
  }

  .sample-question p {
    font-size: 14px;
  }
}

/* === QUESTION SUGGESTION ABOVE INPUT === */
.question-suggestion {
  width: 100%;
  max-width: 48rem;
  text-align: center;
  margin-bottom: 32px; /* Reduced from 24px to 12px for tighter spacing like ChatGPT */
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;

}

.question-suggestion p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Hide question suggestion when chat is active */
#landing-page.chat-active .question-suggestion {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .question-suggestion {
    margin-bottom: 10px; /* Even tighter on mobile */
    padding: 0 1rem;
  }

  .question-suggestion p {
    font-size: 13px;
  }
}

#shortcuts-modal.search-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease;
}

#shortcuts-modal.search-modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

#start-new-chat-modal.search-modal-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

#shortcuts-modal.hidden {
    display: none !important;
}

.shortcut-kbd {
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 6px;
    padding: 4px 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #e4e4e7;
    box-shadow: 0 2px 0 #3f3f46;
    min-width: 24px;
    text-align: center;
    display: inline-block;
}

#shortcuts-modal.search-modal-overlay:not(.hidden) .search-modal-container {
    transform: scale(1);
}

/* AI Generated Image Styles */
.ai-image-container {
    max-width: 512px;
    margin: 16px 0;
}

.ai-image-wrapper {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: #18181b;
    border: 1px solid #27272a;
}

.ai-generated-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.ai-image-wrapper:hover .ai-generated-image {
    transform: scale(1.02);
}

.ai-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
}

.ai-image-wrapper:hover .ai-image-overlay {
    opacity: 1;
}

.ai-image-expand-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.ai-image-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.ai-image-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 9999px;
    border: 1px solid #3f3f46;
    background: transparent;
    color: #a1a1aa;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-image-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #52525b;
    color: #ffffff;
}

.ai-image-action-btn svg {
    flex-shrink: 0;
}

/* Light mode */
.light-mode .ai-image-wrapper {
    background: #f4f4f5;
    border-color: #e4e4e7;
}

.light-mode .ai-image-action-btn {
    border-color: #d4d4d8;
    color: #52525b;
}

.light-mode .ai-image-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: #a1a1aa;
    color: #18181b;
}

/* Image Generation Thinking Animation */
.image-generating {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border: 1px solid rgba(147, 51, 234, 0.2);
    border-radius: 16px;
    margin: 16px 0;
    max-width: 400px;
}

.image-generating-icon {
    width: 24px;
    height: 24px;
    animation: pulse 1.5s ease-in-out infinite;
}

.image-generating-text {
    color: #a78bfa;
    font-size: 14px;
    font-weight: 500;
}

.image-generating-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.95);
    }
}

@keyframes dots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Private Mode Styles */
body.private-mode {
    --theme-bg-main: #050505;
    --theme-text-main: #e0e0e0;
    --theme-accent: #22c55e;
    /* Matrix Green */
}

body.private-mode .theme-bg-card {
    background-color: #0a0a0a !important;
    border-color: #1a1a1a !important;
}

body.private-mode #private-watermark {
    opacity: 1;
}

body.private-mode .welcome-gradient-text {
    background: linear-gradient(to right, #22c55e, #14b8a6) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* ============================================================
    Tablet  (≤ 768px) — hide mode, compress layout
    ============================================================ */
@media (max-width: 768px) {
    .agent-row {
        padding: 12px 14px;
        gap: 10px;
    }

    /* Hide the model/mode label — saves space */
    .agent-row-mode {
        display: none;
    }

    /* Allow description to wrap to a second line instead of truncating */
    .agent-row-description {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* ============================================================
    Mobile  (≤ 520px) — stack into a 2-column card layout
    ============================================================ */
@media (max-width: 520px) {
    .agent-row {
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 12px;
        gap: 8px;
    }

    /* Avatar stays top-left */
    .agent-row-avatar {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        margin-top: 2px;
    }

    /* Info fills remaining width on the first "row" */
    .agent-row-info {
        flex: 1 1 0;
        min-width: 0;
    }

    /* Description can wrap freely on mobile */
    .agent-row-description {
        -webkit-line-clamp: 3;
        white-space: normal;
    }

    /* Status sits below the avatar+info row, indented to align with text */
    .agent-row-status {
        flex: 1 1 auto;
        /* grow to fill space */
        order: 3;
        margin-left: 46px;
        /* avatar width (38) + gap (8) */
        font-size: 0.8rem;
    }

    /* Actions stay at the far right of the status row */
    .agent-row-actions {
        order: 3;
        flex: 0 0 auto;
        margin-left: auto;
        opacity: 1;
    }

    /* Slightly smaller action buttons on mobile */
    .agent-card-action-btn {
        width: 30px;
        height: 30px;
        padding: 5px;
    }
}

/* ============================================================
    Extra-small  (≤ 360px) — ultra-compact
    ============================================================ */
@media (max-width: 360px) {
    .agent-row {
        padding: 10px;
    }

    .agent-row-avatar {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
    }

    .agent-row-status {
        margin-left: 42px;
        /* 34 + 8 */
    }

    .agent-row-name {
        font-size: 0.9rem;
    }

    .agent-row-description {
        font-size: 0.75rem;
    }
}

#quickActionButtons {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin-top: 20px;
    margin-bottom: 12px;
    width: 100%;
    max-width: 740px;
}

/* Mobile: Enable horizontal scroll for quick action buttons */
@media (max-width: 768px) {
    #quickActionButtons {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 0 16px;
        margin-left: -16px;
        margin-right: -16px;
        width: calc(100% + 32px);
        max-width: none;
    }

    #quickActionButtons::-webkit-scrollbar {
        display: none;
    }

    #quickActionButtons .quick-action-btn {
        flex-shrink: 0;
    }
}

#quickActionButtons .quick-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 9999px;
    border: 1px solid #3f3f46;
    background-color: transparent;
    color: #a1a1aa;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    opacity: 1;
    transform: scale(1);
}

#quickActionButtons .quick-action-btn i {
    font-size: 16px;
}

#quickActionButtons .quick-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: #52525b;
    color: #ffffff;
}

#quickActionButtons .quick-action-btn:active {
    transform: scale(0.97);
}

#quickActionButtons .quick-action-btn.hidden-btn {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    width: 0;
    padding: 0;
    margin: 0;
    border: none;
    overflow: hidden;
}

#quickActionButtons .quick-action-btn.active-btn {
    border-color: #52525b;
    color: #ffffff;
}

.light-mode #quickActionButtons .quick-action-btn {
    border-color: #d4d4d8;
    color: #52525b;
    background-color: transparent;
}

.light-mode #quickActionButtons .quick-action-btn:hover,
.light-mode #quickActionButtons .quick-action-btn.active-btn {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: #a1a1aa;
    color: #18181b;
}

.chat-active #quickActionButtons,
.chat-active #actionSuggestions {
    display: none !important;
}

/* Action Suggestions */
#actionSuggestions {
    display: none;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
    width: 100%;
    max-width: 740px;
    animation: fadeIn 0.2s ease;
}

#actionSuggestions.show {
    display: flex;
}

#actionSuggestions .suggestion-item {
    padding: 12px 16px;
    color: #a1a1aa;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 8px;
    text-align: left;
    background: transparent;
    border: none;
    width: 100%;
}

#actionSuggestions .suggestion-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.light-mode #actionSuggestions .suggestion-item {
    color: #52525b;
}

.light-mode #actionSuggestions .suggestion-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #18181b;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
