/* ============================================================
   GLOBAL / THEME
============================================================ */

:root {
  --bg-main: #0e0e0f;
  --bg-elevated: #111;
  --bg-elevated-soft: #1a1a1a;
  --bg-accent: #2d72ff;
  --bg-bubble-user: #3478f6;
  --bg-bubble-assistant: #2a2b32;

  --text-primary: #e6e6e6;
  --text-secondary: #888;
  --text-muted: #777;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
}

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  overflow: hidden;
}

/* Light theme override (soft grey, not harsh white) */
body.theme-light {
  --bg-main: #f4f4f6;
  --bg-elevated: #ffffff;
  --bg-elevated-soft: #f0f0f3;
  --bg-accent: #2563eb;
  --bg-bubble-user: #2563eb;
  --bg-bubble-assistant: #e5e7eb;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.18);

  background: var(--bg-main);
  color: var(--text-primary);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

/* Utility */
.hidden {
  display: none !important;
}

/* ============================================================
   APP SHELL LAYOUT
============================================================ */

.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ============================================================
   SIDEBAR
============================================================ */

.sidebar {
  width: 260px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow-y: auto;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Sidebar header / logo */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header .logo img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Sidebar sections */
.sidebar-section {
  margin-top: 8px;
}

.sidebar-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* Buttons in sidebar */
.sidebar-btn,
.chat-btn {
  background: var(--bg-elevated-soft);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 10px;
  border-radius: 8px;
  margin-top: 8px;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
  text-align: left;
}

.sidebar-btn.primary {
  background: var(--bg-accent);
  border-color: var(--bg-accent);
  color: #fff;
}

.chat-btn.danger {
  background: #991b1b;
  border-color: #7f1d1d;
  color: #fee2e2;
}
.rename-btn {
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.15s;
}

.rename-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}
/* Model select */
#modelSelect {
  background: #0f0f10;
  color: #ffffff;
  border: 1px solid var(--border-subtle);
  padding: 9px 11px;
  border-radius: 8px;
  width: 100%;
  font-size: 14px;
  outline: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='14' viewBox='0 0 20 20' width='14' xmlns='http://www.w3.org/2000/svg'><polygon points='0,0 20,0 10,10'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

#modelSelect option {
  background: #0f0f10;
  color: #ffffff;
}

/* Locked premium models */
#modelSelect option.locked-model {
  color: #777;
  background-color: #222;
  font-style: italic;
}

/* Premium notice */
.premium-model-notice {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.premium-model-notice a {
  color: var(--bg-accent);
  text-decoration: underline;
}

/* Conversation search */
.conv-search {
  margin-top: 10px;
  padding: 8px;
  border-radius: 8px;
  width: 100%;
  background: var(--bg-elevated-soft);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  font-size: 14px;
}

/* Conversations list */
.conversations {
  margin-top: 8px;
}

/* Single conversation item */
.conv-item {
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--bg-elevated-soft);
  cursor: pointer;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.05s ease;
}

.conv-item:hover {
  background: #222533;
  transform: translateY(-1px);
}

body.theme-light .conv-item:hover {
  background: #e5e7eb;
}

.conv-item.active {
  background: #2d2f3a;
}

body.theme-light .conv-item.active {
  background: #d1d5db;
}

/* Conversation title */
.conv-title {
  flex: 1;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* (Old per-chat delete button style kept, but button is no longer rendered) */
.conv-del-btn {
  background: transparent;
  border: none;
  padding: 2px;
  margin-left: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.conv-del-btn svg {
  width: 16px;
  height: 16px;
  stroke: #bfbfbf;
  stroke-width: 1.8;
  transition: stroke 0.18s ease, transform 0.18s ease;
}

.conv-del-btn:hover svg {
  stroke: #ffffff;
  transform: scale(1.1);
}

body.theme-light .conv-del-btn svg {
  stroke: #4b5563;
}

body.theme-light .conv-del-btn:hover svg {
  stroke: #111827;
}

/* Big "Delete chats" button */
.delete-chats-btn {
  width: 100%;
  padding: 10px;
  margin: 6px 0 12px 0;
  border: none;
  border-radius: 8px;
  background: #ff5555;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 14px;
  text-align: center;
}

.delete-chats-btn:hover {
  background: #ff2222;
}

/* ============================================================
   TOP NAV
============================================================ */

.top-nav {
  height: 55px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
}

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

.icon-btn {
  background: var(--bg-elevated-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 9px;
  color: var(--text-primary);
  cursor: pointer;
}

.nav-title span {
  display: block;
  font-size: 13px;
}

.usage-inline {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.usage-progress-wrap {
  width: 140px;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  margin-top: 4px;
  overflow: hidden;
}

.usage-progress {
  height: 100%;
  background: #22c55e;
  width: 30%;
}

/* Right side */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.usage-status {
  font-size: 13px;
  color: var(--text-secondary);
}

.nav-link {
  background: var(--bg-elevated-soft);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13px;
}

.premium-badge {
  background: #facc15;
  color: #1f2933;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* ============================================================
   MAIN PANEL / CHAT AREA
============================================================ */

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Chat layout reserves room for floating input */
.chat-layout {
  flex: 1;
  position: relative;
  padding-bottom: 180px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
}

.chat-messages {
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  position: relative;
  display: block !important; /* override injected flex */
}

.empty-hint {
  position: absolute;
  top: 30%;
  left: 45%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 18px;
  color: #7a7a7a;
  opacity: 0.75;
  pointer-events: none;
}

/* Message rows & bubbles */
.msg-row {
  display: flex;
  gap: 12px;
  margin: 14px 0;
}

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

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

.msg-bubble {
  max-width: 720px;
  padding: 12px 15px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-bubble.user {
  background: var(--bg-bubble-user);
  color: #ffffff;
  border-radius: 18px 18px 4px 18px;
}

.msg-bubble.assistant {
  background: var(--bg-bubble-assistant);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 18px 18px 18px 4px;
}

.assistant-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  margin-top: 4px;
  flex-shrink: 0;
}

/* Typing cursor */
.typing-cursor {
  display: inline-block;
  width: 6px;
  background: #ccc;
  margin-left: 3px;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}

/* ============================================================
   FLOATING CENTERED INPUT BAR (ChatGPT-style)
============================================================ */

.chatgpt-input-wrapper {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  max-width: 92%;
  padding: 12px 14px;

  background: #1f1f1f;
  border: 1px solid var(--border-strong);
  border-radius: 18px;

  display: flex;
  align-items: center;
  gap: 8px;

  box-shadow: 0 0 16px rgba(0, 0, 0, 0.35);
  z-index: 9999;
}

body.theme-light .chatgpt-input-wrapper {
  background: #ffffff;
}

/* Textarea */
.chatgpt-input,
#chatInput {
  flex: 1;
  max-height: 140px;
  resize: none;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 20px;
  outline: none;
  padding: 4px;
}

/* Icon buttons (+, mic) */
.input-icon-btn {
  font-size: 18px;
  padding: 6px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.theme-light .input-icon-btn {
  color: #374151;
}

.input-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.input-icon-btn.mic.recording {
  color: #ff4e4e;
}

/* Send button */
.send-btn,
#sendBtn {
  background: #4a9eff;
  border: none;
  color: white;
  padding: 8px 13px;
  font-size: 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.15s;
}

.send-btn:disabled,
#sendBtn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* + Menu dropdown */
.more-menu {
  position: absolute;
  bottom: 60px;
  left: 16px;

  background: #2a2b32;
  border: 1px solid var(--border-strong);
  border-radius: 12px;

  width: 190px;
  padding: 6px 0;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);

  z-index: 10000;
}

body.theme-light .more-menu {
  background: #ffffff;
}

.more-item {
  padding: 10px 14px;
  color: #fff;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
}

body.theme-light .more-item {
  color: #111827;
}

.more-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

/* Reserve space in messages for the input bar */
.chat-layout {
  padding-bottom: 180px;
}

.chat-messages {
  padding-bottom: 200px;
}

/* ============================================================
   FOOTER (Simple, centered, no box)
============================================================ */

.footer,
footer.footer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  max-width: 92%;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  opacity: 0.85;
  background: none;
  border: none;
  box-shadow: none;
  z-index: 8000;
}

.footer-text {
  display: inline-block;
}

/* Cookie link in footer */
.cookie-link {
  cursor: pointer;
  text-decoration: underline;
}
.cookie-link:hover {
  color: var(--text-primary);
}

/* ============================================================
   MODALS (Login / Register / Cookies)
============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none;
}

.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

/* Login / register panels */
.login-panel {
  position: relative;
  z-index: 2;
  width: 380px;
  padding: 26px;
  border-radius: 16px;
  background: #111;
  color: #fff;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

body.theme-light .login-panel {
  background: #ffffff;
  color: #111827;
}

.login-logo {
  width: 80px;
  margin-bottom: 10px;
}

.login-title {
  margin: 8px 0 20px;
  font-size: 22px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  padding: 11px;
  margin: 8px 0;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1c1c1c;
  color: white;
  font-size: 15px;
  outline: none;
}

body.theme-light .login-form input {
  background: #f3f4f6;
  color: #111827;
  border-color: #d1d5db;
}

.login-form input:focus {
  border-color: #4a8bff;
  box-shadow: 0 0 5px #4a8bff;
}

.login-btn {
  width: 100%;
  padding: 11px;
  margin-top: 10px;
  background: #3069ff;
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 15px;
  cursor: pointer;
}

.close-btn {
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  background: #2a2a2a;
  border: none;
  border-radius: 10px;
  color: #ccc;
  cursor: pointer;
}

/* Cookie preferences modal */
.cookie-box {
  position: relative;
  z-index: 2;
  background: #1f1f1f;
  color: #fff;
  width: 360px;
  padding: 22px;
  border-radius: 14px;
  border: 1px solid #444;
}

body.theme-light .cookie-box {
  background: #ffffff;
  color: #111827;
  border-color: #d1d5db;
}

.cookie-title {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 18px;
}

.cookie-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 10px;
  background: #262626;
  border-radius: 10px;
}

body.theme-light .cookie-row {
  background: #f3f4f6;
}

.cookie-icon {
  font-size: 20px;
}

.cookie-info p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Toggle switch */
.toggle {
  margin-left: auto;
  position: relative;
  width: 44px;
  height: 22px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #555;
  border-radius: 999px;
  transition: 0.2s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle input:checked + .slider {
  background-color: #22c55e;
}

.toggle input:checked + .slider:before {
  transform: translateX(20px);
}

/* Cookie buttons */
.cookie-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.modal-btn {
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.modal-btn.accept {
  background: #22c55e;
  color: #fff;
}

.modal-btn.reject {
  background: #4b5563;
  color: #e5e7eb;
}

.modal-btn.save {
  background: #3b82f6;
  color: #fff;
}

.modal-close {
  margin-top: 10px;
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  border: none;
  background: #374151;
  color: #e5e7eb;
  cursor: pointer;
}

/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .chatgpt-input-wrapper {
    bottom: 70px;
    width: 96%;
  }

  .footer {
    width: 96%;
  }
}

/* ============================================================
   CHAT IMAGE + LOADING + ACTIONS
============================================================ */

.full-image-wrap {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.chat-image {
  max-width: 450px;
  width: 100%;
  border-radius: 16px;
  display: block;
}

/* Image options under user image */
.image-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
}

.image-options .image-action-btn {
  background: #20232a;
  border: 1px solid #3a3f4b;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  color: #e6e6e6;
}

.image-options .image-action-btn:hover {
  background: #2b303a;
}

/* ChatGPT-style image loading box */
.image-loading-box {
  width: 512px;
  height: 512px;
  max-width: 90vw;
  max-height: 90vw;
  border-radius: 18px;
  margin: 16px auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.theme-light .image-loading-box {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.05);
}

.image-loading-box.image-loaded {
  border-color: transparent;
  background: none;
}

.image-loading-pulse {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.8);
  border-top-color: transparent;
  animation: imageSpin 0.9s linear infinite;
}

.theme-light .image-loading-pulse {
  border-color: rgba(0,0,0,0.5);
  border-top-color: transparent;
}

@keyframes imageSpin {
  0%   { transform: rotate(0deg);   opacity: 0.9; }
  100% { transform: rotate(360deg); opacity: 1;   }
}

.ai-generated-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 16px;
}

/* Make sure chat rows can center images nicely */
.msg-row.assistant-row .msg-bubble.assistant {
  display: block;
}

/* ============================================================
   DRAG & DROP OVERLAY
============================================================ */

.drop-zone {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 22px;
  border: 3px dashed #4a9eff;
  z-index: 9998;
  transition: 0.2s ease;
}

.drop-zone.hidden {
  display: none;
}

.drop-zone p {
  background: #222;
  padding: 20px 40px;
  border-radius: 10px;
  border: 2px solid #4a9eff;
}
.zip-preview {
  background: #111;
  padding: 6px;
  margin: 4px 0;
  border-radius: 6px;
  color: #9f9f9f;
  font-size: 11px;
  max-height: 150px;
  overflow-y: auto;
}

.zip-binary-note {
  color: #888;
  font-size: 11px;
  margin-left: 6px;
}
.reasoning-line {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 4px;
  transition: opacity 0.25s ease;
}

.dots {
  font-size: 16px;
  letter-spacing: 3px;
  opacity: 0.7;
  animation: dotsBlink 1.2s infinite;
}

@keyframes dotsBlink {
  0% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}
/* Sidebar title */
.sidebar-title {
    font-size: 15px;
    font-weight: 700;
    padding: 16px 14px 6px;
    color: #cfcfcf;
    text-transform: uppercase;
    opacity: .9;
}

/* Pretty Clear All Chats button */
.pretty-clear-btn {
    display: block;
    width: calc(100% - 20px);
    margin: 6px auto 12px;
    padding: 8px 12px;
    background: #2c2f36;
    color: #ff6b6b;
    border: 1px solid #444;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s ease;
}

.pretty-clear-btn:hover {
    background: #3a3f47;
    border-color: #ff6b6b;
    color: #ff8585;
}

.pretty-clear-btn:active {
    transform: scale(0.97);
}
/* Neon / Glass Clear Chats Button */
.neon-clear-btn {
    width: calc(100% - 24px);
    margin: 8px auto 14px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #ff6bcb;

    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px) saturate(180%);
    -webkit-backdrop-filter: blur(6px) saturate(180%);

    border: 1px solid rgba(255, 107, 203, 0.4);
    border-radius: 10px;

    box-shadow: 0 0 10px rgba(255, 107, 203, 0.1),
                inset 0 0 10px rgba(255, 107, 203, 0.15);
                
    cursor: pointer;
    text-align: center;
    transition: 0.25s ease;
}

/* Hover glow */
.neon-clear-btn:hover {
    color: #ff8ee8;
    background: rgba(255, 255, 255, 0.12);

    box-shadow: 
        0 0 12px rgba(255, 107, 203, 0.5),
        0 0 25px rgba(255, 107, 203, 0.4),
        inset 0 0 12px rgba(255, 107, 203, 0.4);
    
    border-color: rgba(255, 107, 203, 0.8);
}

/* Click animation */
.neon-clear-btn:active {
    transform: scale(0.96);
    box-shadow: 
        0 0 6px rgba(255, 107, 203, 0.8),
        inset 0 0 12px rgba(255, 107, 203, 0.7);
}
/* ===============================
   GPTs / Projects / Chats sidebar
   Neon blue glassy buttons
================================ */

.sidebar-divider {
  border: none;
  border-top: 1px solid rgba(59, 130, 246, 0.25);
  margin: 10px 0 8px;
}

/* Base bullet-style subitem button */
.sidebar-subitem-btn {
  width: 100%;
  padding: 6px 10px;
  margin: 3px 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-primary);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.08s ease, border-color 0.18s ease;
}

.sidebar-subitem-btn .dot-bullet {
  font-size: 14px;
  opacity: 0.9;
}

/* Neon glass variants */
.sidebar-subitem-btn.neon-button {
  border-color: rgba(37, 99, 235, 0.7);
  background: radial-gradient(circle at 0 0, rgba(59,130,246,0.35), rgba(15,23,42,0.8));
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.45);
}

.sidebar-subitem-btn.neon-button:hover {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
  transform: translateY(-1px);
}

/* Ghost / neutral */
.sidebar-subitem-btn.neon-ghost {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.4);
}

.sidebar-subitem-btn.neon-ghost:hover {
  border-color: rgba(148, 163, 184, 0.75);
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.45);
  transform: translateY(-1px);
}

/* Danger (Clear All Chats) */
.sidebar-subitem-btn.neon-danger {
  border-color: rgba(239, 68, 68, 0.7);
  background: radial-gradient(circle at 0 0, rgba(248,113,113,0.34), rgba(15,23,42,0.9));
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.55);
  color: #fee2e2;
}

.sidebar-subitem-btn.neon-danger:hover {
  box-shadow: 0 0 24px rgba(248, 113, 113, 0.9);
  transform: translateY(-1px);
}

/* Lists for GPTs / Projects */
.sidebar-sublist {
  margin-top: 4px;
}

/* Saved GPT / Project rows (reuse ghost style) */
.sidebar-sublist .sidebar-subitem-row {
  width: 100%;
  padding: 5px 9px;
  margin: 2px 0;
  border-radius: 999px;
  border: 1px solid rgba(30, 64, 175, 0.6);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-primary);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.08s ease;
}

.sidebar-sublist .sidebar-subitem-row .dot-bullet {
  font-size: 12px;
  color: #60a5fa;
}

.sidebar-sublist .sidebar-subitem-row:hover {
  background: rgba(30, 64, 175, 0.85);
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.7);
  transform: translateY(-1px);
}

/* Light theme adjustments */
body.theme-light .sidebar-subitem-btn,
body.theme-light .sidebar-sublist .sidebar-subitem-row {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(148, 163, 184, 0.7);
  color: #111827;
}

body.theme-light .sidebar-subitem-btn.neon-button {
  background: radial-gradient(circle at 0 0, rgba(59,130,246,0.6), #ffffff);
}

body.theme-light .sidebar-subitem-btn.neon-danger {
  background: radial-gradient(circle at 0 0, rgba(248,113,113,0.7), #ffffff);
}

/* Sidebar title keeps its original styling but you can upgrade it */
.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    padding: 16px 14px 4px;
    color: #dcdce0;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* Neon Blue / GPT-5 Clear Chats Button */
.neon-clear-btn-blue {
    width: calc(100% - 24px);
    margin: 8px auto 14px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #58b7ff;

    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px) saturate(180%);
    -webkit-backdrop-filter: blur(8px) saturate(180%);

    border: 1px solid rgba(88, 183, 255, 0.45);
    border-radius: 12px;

    box-shadow: 
        0 0 12px rgba(88, 183, 255, 0.25),
        inset 0 0 10px rgba(88, 183, 255, 0.2);

    cursor: pointer;
    text-align: center;
    transition: 0.25s ease;
}

/* Hover Glow — electric GPT-5 aura */
.neon-clear-btn-blue:hover {
    color: #8fd4ff;
    background: rgba(255, 255, 255, 0.12);

    box-shadow:
        0 0 18px rgba(88, 183, 255, 0.65),
        0 0 40px rgba(88, 183, 255, 0.55),
        inset 0 0 16px rgba(88, 183, 255, 0.55);

    border-color: rgba(88, 183, 255, 0.95);
}

/* Active click pop */
.neon-clear-btn-blue:active {
    transform: scale(0.96);
    box-shadow:
        0 0 10px rgba(88, 183, 255, 0.9),
        inset 0 0 18px rgba(88, 183, 255, 0.8);
}
/* Sidebar title fix */
.sidebar-label {
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

/* Ensure sidebar section stacks elements vertically */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Make neon button full width and centered */
.neon-clear-btn-blue {
    width: 100%;
    padding: 12px;
    text-align: center;
    display: block;

    background: rgba(88, 183, 255, 0.08);
    border: 1px solid rgba(88, 183, 255, 0.3);
    border-radius: 12px;

    color: #58b7ff;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 0 8px rgba(88, 183, 255, 0.3),
        inset 0 0 8px rgba(88, 183, 255, 0.15);

    transition: 0.25s ease;
}

.neon-clear-btn-blue:hover {
    background: rgba(88, 183, 255, 0.15);
    border-color: rgba(88, 183, 255, 0.6);
    box-shadow:
        0 0 16px rgba(88, 183, 255, 0.6),
        inset 0 0 14px rgba(88, 183, 255, 0.5);
}

.neon-clear-btn-blue:active {
    transform: scale(0.97);
}
/* ===============================
   NEON TOP BAR (GPT-5 STYLE)
================================*/

.top-nav {
    height: 55px;
    background: rgba(10, 12, 20, 0.55);
    border-bottom: 1px solid rgba(88, 183, 255, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 0 20px rgba(88, 183, 255, 0.15);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Neon button style */
.neon-btn {
    background: rgba(20, 25, 40, 0.4);
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid rgba(88, 183, 255, 0.6);
    color: #80cfff;
    cursor: pointer;
    font-size: 13px;
    backdrop-filter: blur(8px);
    transition: 0.2s ease-in-out;
}

.neon-btn:hover {
    background: rgba(88, 183, 255, 0.12);
    border-color: #58b7ff;
    box-shadow: 0 0 12px #58b7ff;
}

/* Status text */
.usage-status {
    color: #a8c7ff;
    font-size: 13px;
}

/* Premium badge */
.premium-badge {
    background: #facc15;
    color: #000;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

/* Sidebar toggle button */
.icon-btn {
    background: rgba(20, 20, 30, 0.4);
    border: 1px solid rgba(88,183,255,0.4);
    color: #80cfff;
    border-radius: 8px;
    padding: 6px 10px;
}

.icon-btn:hover {
    background: rgba(88,183,255,0.15);
    box-shadow: 0 0 10px #58b7ff;
}

/* Adjust for light theme */
body.theme-light .neon-btn {
    border-color: rgba(40, 120, 255, 0.6);
    color: #0a2a66;
}
/* Make left group stretch full width */
.top-nav .nav-left {
    display: flex;
    align-items: center;
    flex: 1;
}

/* Push the SmartGPT status text more to the right */
/* Move SmartGPT Message Status flush left */
.top-nav .nav-title {
    margin-left: 10px !important;   /* small padding */
    font-size: 14px; 
    line-height: 1.4;
    color: #d9e8ff;
    white-space: nowrap;
}
/* Align status exactly with sidebar edge */
.nav-title {
    padding-left: 4px;
}


.neon-clear-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(0, 180, 255, 0.12);
    border: 1px solid rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 8px rgba(0, 180, 255, 0.6);
    color: #8ee7ff;
    transition: 0.25s;
}

.neon-clear-btn:hover {
    background: rgba(0, 180, 255, 0.25);
    box-shadow: 0 0 12px rgba(0, 200, 255, 0.8);
    transform: scale(1.03);
}

.neon-clear-btn .icon {
    margin-right: 6px;
}
/* Move SmartGPT Message Status toward the left */
.top-status-bar {
    display: flex;
    justify-content: flex-start !important;
    padding-left: 20px !important;
    gap: 20px;
}

/* Optional: keep it visually aligned with sidebar height */
.top-status-bar .usage-wrapper {
    margin-left: 220px;
}
/* Smaller, centered upload drop zone */
#dropZone {
    position: absolute;
    top: 50%;
    left: calc(50% + 120px); /* pushes slightly right so it stays inside chat area */
    transform: translate(-50%, -50%);
    
    width: 280px;        /* smaller width */
    height: 90px;        /* smaller height */

    border: 2px solid #4a9eff;
    border-radius: 14px;

    background: rgba(0, 0, 0, 0.75);
    box-shadow: 0 0 14px rgba(0, 128, 255, 0.45);

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

    z-index: 5000;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

#dropZone.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Ensure sidebar dragging NEVER triggers file-drop styling */
.sidebar:hover ~ #dropZone,
.sidebar:active ~ #dropZone {
    opacity: 0 !important;
    visibility: hidden !important;
}
/* Neon Blue New Chat Button in Sidebar */
.neon-new-chat {
    width: 100%;
    padding: 10px 14px;
    margin: 10px 0 12px 0;

    background: rgba(0, 102, 255, 0.25);
    border: 1px solid rgba(0, 140, 255, 0.6);

    border-radius: 12px;
    color: #cfe6ff;
    font-size: 15px;
    font-weight: 500;
    text-align: left;

    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 12px rgba(0, 140, 255, 0.4);
}

.neon-new-chat:hover {
    background: rgba(0, 102, 255, 0.4);
    box-shadow: 0 0 16px rgba(0, 140, 255, 0.8);
}
.neon-btn {
    background: #1e5bff;
    color: white;
    padding: 10px 16px;
    width: 100%;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    margin-top: 12px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(30, 91, 255, 0.8);
    transition: 0.2s;
}

.neon-btn:hover {
    box-shadow: 0 0 15px rgba(30, 91, 255, 1);
    background: #2d6bff;
}
.hidden-btn {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
}
.conv-delete-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  margin-left: 4px;
  opacity: 0.75;
}
.conv-delete-btn:hover {
  opacity: 1;
  transform: scale(1.05);
}
.gpt-rename-btn,
.project-rename-btn {
  border: none;
  background: transparent;
  color: #74a6ff;
  cursor: pointer;
  font-size: 14px;
  margin-left: 4px;
}

.gpt-rename-btn:hover,
.project-rename-btn:hover {
  transform: scale(1.1);
  color: #a9c8ff;
}
/* ============================================================
   LAYOUT RESTORE PATCH — FIXES BROKEN INDEX LAYOUT
   (Adds no visual redesign, keeps your neon + pastel look)
============================================================ */

/* Restore main layout structure */
.app-shell {
    display: flex !important;
    height: 100vh !important;
    width: 100vw !important;
}

/* Restore sidebar width + structure */
.sidebar {
    width: 260px !important;
    flex-shrink: 0 !important;
}

/* Restore chat layout height */
.chat-layout {
    flex: 1 !important;
    position: relative !important;
    padding-bottom: 180px !important;
    height: calc(100vh - 55px) !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Restore chat message scrolling area */
.chat-messages {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 20px !important;
    padding-bottom: 200px !important;
    display: block !important;
}

/* Fix floating input bar overlap */
.chatgpt-input-wrapper {
    position: fixed !important;
    bottom: 70px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 9999 !important;
}

/* Prevent pastel theme from removing structure */
body.theme-light .sidebar {
    background: rgba(240,245,255,0.9) !important;
}

body.theme-light .chat-messages {
    background: #e8f1ff !important;
}

body.theme-light .top-nav {
    background: rgba(232,241,255,0.75) !important;
}

body.theme-light .chatgpt-input-wrapper {
    background: #ffffff !important;
}

/* Fix misplaced “empty hint” */
.empty-hint {
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* Fix drag-drop blocking layout */
#dropZone {
    position: fixed !important;
}
/* ============================================================
   TEXT VISIBILITY PATCH — PASTEL LIGHT THEME
   Ensures all UI text is readable on pastel backgrounds
============================================================ */

body.theme-light,
body.theme-light * {
    color: #111 !important;
}

/* Chat bubbles */
body.theme-light .msg-bubble.user,
body.theme-light .msg-bubble.assistant {
    color: #111 !important;
}

/* Sidebar text */
body.theme-light .sidebar,
body.theme-light .sidebar * {
    color: #111 !important;
}

/* GPT & Project lists */
body.theme-light .gpt-item,
body.theme-light .project-item {
    color: #111 !important;
}

body.theme-light .gpt-name,
body.theme-light .project-name {
    color: #111 !important;
}

/* Buttons */
body.theme-light button,
body.theme-light .btn,
body.theme-light .image-action-btn,
body.theme-light .zip-analyze-btn {
    color: #111 !important;
}

/* Input field */
body.theme-light #chatInput {
    color: #111 !important;
    background: #ffffff !important;
    border-color: #bbb !important;
}

/* Placeholder text */
body.theme-light #chatInput::placeholder {
    color: #555 !important;
}

/* Top heading, greeting, usage bar text */
body.theme-light #topGreeting,
body.theme-light #usageInline,
body.theme-light #statusText {
    color: #111 !important;
}

/* Dropdown model selector */
body.theme-light #modelSelect {
    color: #111 !important;
    background: #fff !important;
    border-color: #ccc !important;
}

/* Modal windows */
body.theme-light .modal,
body.theme-light .modal * {
    color: #111 !important;
}

/* Files, ZIP, image actions */
body.theme-light .file-bubble,
body.theme-light .zip-bubble {
    color: #111 !important;
}

/* Chat assistant logo bubble alignment fix */
body.theme-light .assistant-row .msg-bubble {
    color: #111 !important;
}

/* More-menu on top-right */
body.theme-light #moreMenu,
body.theme-light #moreMenu * {
    color: #111 !important;
}

/* Header bar */
body.theme-light .top-nav,
body.theme-light .chat-header {
    color: #111 !important;
}

/* Fix icons (emoji buttons) */
body.theme-light .icon-button,
body.theme-light .nav-icon {
    color: #111 !important;
}

/* Image inspector text */
body.theme-light .image-options button {
    color: #111 !important;
}

/* Sidebar search input */
body.theme-light #convSearch {
    color: #111 !important;
    background: #fff !important;
}

/* Cookie modal text */
body.theme-light #cookieModal,
body.theme-light #cookieModal * {
    color: #111 !important;
}
/* ============================================================
   Light Theme — Fix Model Dropdown Background for Readability
============================================================ */

body.theme-light select,
body.theme-light #modelSelect {
    background: #e8f1ff !important; /* pastel blue */
    color: #111 !important;          /* readable text */
    border: 1px solid #b7c8e6 !important;
}

/* Dropdown list panel */
body.theme-light select option,
body.theme-light #modelSelect option {
    background: #e8f1ff !important;  /* pastel blue */
    color: #111 !important;          /* readable */
}

/* Optional: add hover highlight */
body.theme-light #modelSelect option:hover {
    background: #d9e8ff !important;  /* slightly darker pastel */
    color: #000 !important;
}



