:root {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --color-primary: #10a37f;
  --color-primary-dark: #1a7f64;
  --color-bg-sidebar: #171717;
  --color-bg-primary: #212121;
  --color-bg-hover: #2a2b32;
  --color-border: rgba(255, 255, 255, 0.1);
  --transition-sidebar: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --color-text-primary: #ececf1;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZmlsdGVyIGlkPSJmIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iLjc1IiBudW1PY3RhdmVzPSIzIiAvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbHRlcj0idXJsKCNmKSIgb3BhY2l0eT0iMC4wMjUiIC8+PC9zdmc+');
  pointer-events: none;
  opacity: 0.15;
  z-index: 1;
}

/* main app container */
.app {
  display: flex;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

/* ----- sidebar ----- */
.sidebar {
  width: 240px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(10, 10, 10, 0.7);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
  position: relative;
  transition: width var(--transition-sidebar);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .search-area span:not(.nav-icon),
.sidebar.collapsed .profile-text,
.sidebar.collapsed .history-item .title,
.sidebar.collapsed .history-item .timestamp,
.sidebar.collapsed .nav-title {
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity 0.2s, width 0.2s;
}

.sidebar.collapsed .nav-item,
.sidebar.collapsed .history-item,
.sidebar.collapsed .profile-area {
  justify-content: center;
  padding: 10px 0;
}

.sidebar.collapsed .nav-icon {
  font-size: 18px;
}

.sidebar.collapsed .logo-area {
  justify-content: center;
  padding: 16px 0;
}

.sidebar.collapsed .logo-area span {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar {
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.sidebar.hidden {
  transform: translateX(-100%);
  opacity: 0;
}

/* Hide second nav section in collapsed mode */
.sidebar.collapsed .nav-section:nth-of-type(2) {
  display: none;
}

/* Hide floating toggle button on desktop */
.toggle-sidebar {
  display: none;
}

@media (max-width: 768px) {
  #toggleSidebar {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 2001;
    /* Above mobile header */
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    color: #ececf1;
  }

  #toggleSidebar:hover {
    background: rgba(255, 255, 255, 0.05);
  }
}

.toggle-sidebar:hover {
  background: rgba(30, 41, 59, 0.9);
}

.toggle-sidebar i {
  font-size: 16px;
  color: #e2e8f0;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  transition: padding 0.2s;
}

.logo-area i {
  font-size: 28px;
}

.logo-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.4));
}

.search-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 10px;
  padding: 6px 12px;
  background: rgba(20, 20, 20, 0.5);
  border: 1px solid var(--color-border);
  border-radius: 40px;
  color: #aaa;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s, transform 0.1s;
  gap: 6px;
}

.search-area:hover {
  background: rgba(30, 30, 30, 0.5);
  transform: translateY(-1px);
}

.search-shortcut {
  font-size: 11px;
  padding: 3px 6px;
  background: rgba(30, 30, 30, 0.5);
  border-radius: 6px;
}

.nav-section {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.nav-section:last-of-type {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.nav-title {
  font-size: 10px;
  color: #777;
  padding: 6px 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: opacity 0.2s;
}

/* Increased base size for nav items */
.nav-item,
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  margin: 1px 6px;
  border-radius: 8px;
  color: #ddd;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.nav-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

/* New Chat button specific */
#newChatBtn {
  font-size: 15px;
  font-weight: 500;
}

/* Explore view specific */
.nav-item[data-view="explore"] {
  font-size: 15px;
}

.nav-item.active,
.history-item.active {
  background: var(--color-bg-hover);
  color: white;
  position: relative;
}

.nav-item.active::before,
.history-item.active::before {
  content: '';
  position: absolute;
  left: -6px;
  width: 3px;
  height: 60%;
  background: var(--color-primary);
  border-radius: 4px;
}

.nav-item:hover,
.history-item:hover {
  background: var(--color-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-item:hover .nav-icon {
  transform: scale(1.15);
  transition: transform 0.15s ease;
}

.history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.history-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.history-item .title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item .timestamp {
  font-size: 9px;
  opacity: 0.5;
  color: #666;
  margin-left: auto;
  white-space: nowrap;
}

.history-item .menu-btn {
  opacity: 0;
  margin-left: 8px;
  padding: 4px 8px;
  color: #888;
  transition: opacity 0.15s;
}

.history-item:hover .menu-btn {
  opacity: 1;
}

.menu-btn:hover {
  color: white;
}

/* Profile area - increased font size */
.profile-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 6px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  color: #ddd;
  transition: background 0.15s ease, transform 0.15s ease;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-area:hover {
  background: var(--color-bg-hover);
  transform: translateY(-1px);
}

.profile-icon {
  font-size: 22px;
  width: 28px;
  text-align: center;
}

.profile-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

#profileName {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

#profileStatus {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.profile-menu-btn {
  opacity: 0.6;
  transition: opacity 0.15s;
}

.profile-area:hover .profile-menu-btn {
  opacity: 1;
}

/* dropdown menus */
.dropdown-menu {
  position: absolute;
  background: rgba(15, 15, 15, 0.95);
  color: #e5e5e5;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  z-index: 100;
  min-width: 160px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.dropdown-menu.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item {
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #ccc;
  transition: background 0.1s, color 0.1s;
  font-size: 13px;
}

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

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

.profile-menu {
  bottom: calc(100% + 8px);
  left: 8px;
  width: 200px;
}

.chat-menu {
  position: fixed;
  z-index: 200;
}

.credit {
  padding: 8px 16px;
  font-size: 11px;
  color: #666;
  text-align: center;
  flex-shrink: 0;
}

.sidebar.collapsed .credit {
  display: none;
}

/* ----- main panel ----- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  position: relative;
  height: 100%;
  overflow: hidden;
  min-height: 0;
  /* allows children to scroll */
}

.grok-bar {
  margin: 16px auto 0;
  width: 95%;
  padding: 14px 20px;
  border-radius: 18px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  min-height: 60px;
}

.grok-bar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(96, 165, 250, 0.6),
      transparent);
  pointer-events: none;
}

.grok-title {
  font-size: 22px;
  font-weight: 600;
  color: white;
}

.back-btn {
  font-size: 24px;
  cursor: pointer;
  color: #aaa;
  transition: color 0.1s;
}

.back-btn:hover {
  color: white;
}

/* ----- views (chat / explore / settings) ----- */
.view-chat,
.view-explore,
.view-settings,
.view-dashboard {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.view-chat {
  overflow: hidden;
  /* chat has its own scrolling container */
}

.view-explore,
.view-settings,
.view-dashboard {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.view-explore,
.view-settings {
  padding: 24px;
}

.view-explore .view-content {
  max-width: none;
  margin: 0;
  width: 100%;
}

/* explore */
.explore-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--color-border);
  border-radius: 60px;
  padding: 12px 20px;
  margin-bottom: 28px;
}

.explore-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  outline: none;
}

.explore-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed-item {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 20px;
}

/* settings */
.settings-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.tab-btn {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--color-border);
  color: #aaa;
  padding: 8px 20px;
  border-radius: 40px;
  cursor: pointer;
  transition: background 0.1s;
}

.tab-btn.active {
  background: rgba(30, 30, 30, 0.8);
  color: white;
  border-color: rgba(255, 255, 255, 0.1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* SETTINGS CARD (ChatGPT Inspired) */
.settings-form {
  background: #171717;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 32px;
  max-width: 650px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.subscription-card {
  background: linear-gradient(145deg, #10a37f22, transparent);
  border: 1px solid #10a37f44;
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sub-info h4 {
  color: #10a37f;
  margin-bottom: 4px;
  font-size: 18px;
}

.sub-info p {
  color: #8e8ea0;
  font-size: 14px;
}

/* Labels */
.settings-form label {
  font-size: 13px;
  opacity: 0.6;
  display: block;
  margin-bottom: 6px;
}

/* Info text */
.settings-form p {
  font-size: 15px;
  margin-bottom: 20px;
  font-weight: 500;
}

/* Logout button */
.logout-settings-btn {
  background: linear-gradient(135deg, #ff4d4d, #cc0000);
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-settings-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 0, 0, 0.3);
}

.settings-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  color: white;
  cursor: pointer;
  transition: 0.2s ease;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 10px 24px;
  border-radius: 40px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* history modal (full view) */
.history-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.history-modal-content {
  width: 80%;
  max-width: 1000px;
  height: 80%;
  background: #111;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  color: white;
}

.history-full-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-full-list .history-item {
  margin: 2px 0;
}

.close-history {
  font-size: 28px;
  cursor: pointer;
  color: #aaa;
  transition: color 0.1s;
}

.close-history:hover {
  color: white;
}

/* Chat search input */
#chatSearchInput {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  outline: none;
  font-size: 13px;
}

#chatSearchInput::placeholder {
  color: #555;
}

.search-content {
  display: flex;
  flex-direction: column;
}

.preview {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
  line-height: 1.4;
}

.highlight {
  background: rgba(96, 165, 250, 0.25);
  color: #fff;
  padding: 1px 3px;
  border-radius: 4px;
}

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

.rename-input {
  background: transparent;
  border: none;
  color: #ddd;
  font-size: inherit;
  outline: none;
  width: 100%;
}

/* Admin link hidden by default */
.admin-link {
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Visible state */
.admin-link.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.admin-badge {
  background: rgba(255, 255, 255, 0.1);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.admin-badge.visible {
  opacity: 1;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Critical height fixes */
html,
body {
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Body background and global */
body {
  background: radial-gradient(circle at 30% 20%,
      rgba(96, 165, 250, 0.06),
      transparent 40%),
    radial-gradient(circle at 80% 80%,
      rgba(59, 130, 246, 0.05),
      transparent 50%),
    #050505;
  color: #eee;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
}

.chat-container {
  scrollbar-width: thin;
}

.chat-container::-webkit-scrollbar {
  width: 6px;
}

.chat-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.plus-btn {
  order: 0;
  background: transparent;
  border: none;
  color: #888;
  font-size: 18px;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.plus-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

.input-wrapper.focused {
  box-shadow:
    0 0 0 2px rgba(96, 165, 250, 0.25),
    0 20px 60px rgba(0, 0, 0, 0.6);
}

.message-input {
  font-size: 16px;
}

.send-btn,
.stop-btn {
  padding: 12px 16px;
}

/* ----- responsive (merged both @media blocks for max-width:768px) ----- */
@media (max-width: 768px) {

  .sidebar.mobile-visible,
  .sidebar.mobile-open {
    /* support both classes for consistency */
    left: 0;
  }

  .main {
    margin-left: 0 !important;
  }

  .grok-bar {
    padding: 12px 16px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
  }

  .grok-title {
    font-size: 18px;
    font-weight: 600;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .back-btn {
    font-size: 20px;
  }

  /* History modal on mobile */
  .history-modal {
    align-items: flex-end;
  }

  .history-modal-content {
    width: 100%;
    height: 90%;
    border-radius: 20px 20px 0 0;
  }

  .nav-item,
  .history-item {
    padding: 14px 16px;
    font-size: 14px;
  }

  .profile-area {
    padding: 16px;
  }

  body::after {
    opacity: 0.05;
  }

  #particle-canvas {
    opacity: 0.3;
  }

  .mobile-menu-btn {
    display: block;
  }
}

@media (max-width: 480px) {
  .input-wrapper {
    background: rgba(15, 15, 15, 0.9);
    border: 1px solid rgba(96, 165, 250, 0.15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  }

  .input-wrapper.focused {
    box-shadow:
      0 0 0 2px rgba(96, 165, 250, 0.25),
      0 20px 60px rgba(0, 0, 0, 0.6);
  }

  .message-input {
    font-size: 16px;
  }

  .send-btn,
  .stop-btn {
    padding: 12px 16px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }

  .sidebar.collapsed {
    width: 64px;
  }

  .grok-title {
    font-size: 22px;
  }
}

/* Mobile menu button - hidden by default on desktop */
.mobile-menu-btn {
  display: none;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 50;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main {
    width: 100%;
  }

}

@media (min-width: 769px) {
  .toggle-sidebar {
    display: none;
  }
}

.auth-modal {
  position: fixed;
  inset: 0;

  background:
    radial-gradient(circle at center,
      rgba(96, 165, 250, 0.18),
      rgba(0, 0, 0, 0.9));

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.auth-modal.active {
  display: flex;
}

.auth-box {
  position: relative;
  width: 420px;
  padding: 48px 40px;
  border-radius: 32px;
  background: linear-gradient(160deg,
      rgba(10, 12, 22, 0.95),
      rgba(15, 18, 35, 0.95));
  border: 1px solid rgba(96, 165, 250, 0.15);
  box-shadow:
    0 0 60px rgba(96, 165, 250, 0.08),
    0 30px 80px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: modalFade 0.25s ease;
}

.auth-box h2 {
  text-align: center;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.5px;
}

.auth-box input {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
  transition: all 0.25s ease;
}

.auth-box input:focus {
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 0 18px rgba(96, 165, 250, 0.25);
}

.auth-box button {
  padding: 14px;
  border-radius: 16px;
  font-weight: 500;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: 0.2s ease;
}

#emailLoginBtn,
#emailSignupBtn {
  background: linear-gradient(135deg,
      #2563eb,
      #1d4ed8);
}

#emailLoginBtn:hover,
#emailSignupBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

#googleLoginBtn {
  padding: 15px;
  border-radius: 18px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  transition: all 0.25s ease;
}

#googleLoginBtn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.6;
}

.auth-close:hover {
  opacity: 1;
}

@keyframes modalFade {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.auth-toast {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 10px;
  text-align: center;
  animation: fadeIn 0.2s ease;
}

.auth-toast {
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #e2e8f0;
}

.auth-toast.error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.auth-toast.info {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

/* Fix scroll button position */
.scroll-bottom-btn {
  position: fixed !important;
  z-index: 100 !important;
}

/* Make voice button match other action buttons */
.voice-input-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

/* Profile menu positioning */
.profile-area {
  position: relative;
}

.profile-menu {
  bottom: 100%;
  left: 8px;
  margin-bottom: 8px;
}

.auth-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #aaa;
}

.auth-close:hover {
  color: #fff;
}

.auth-box h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  text-align: center;
}

.auth-box input {
  width: 100%;
  padding: 12px;
  margin-bottom: 1rem;
  background: #2d2d3a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  font-size: 1rem;
}

.auth-box button {
  width: 100%;
  padding: 12px;
  margin-bottom: 0.8rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#googleLoginBtn {
  background: #fff;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#googleLoginBtn:hover {
  background: #f0f0f0;
}

.auth-box p {
  text-align: center;
  margin: 1rem 0 0;
}

.auth-box a {
  text-align: center;
  font-size: 13px;
  color: rgba(96, 165, 250, 0.8);
  text-decoration: none;
  margin-top: 8px;
  transition: 0.2s;
}

.auth-box a:hover {
  color: #60a5fa;
}

.auth-box::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 32px;
  padding: 1px;
  background: linear-gradient(120deg,
      rgba(96, 165, 250, 0.4),
      transparent,
      rgba(96, 165, 250, 0.4));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.3;
}

.profile-menu {
  position: absolute;
  bottom: 100%;
  left: 8px;
  margin-bottom: 10px;
  width: 200px;
  background: rgba(15, 15, 20, 0.95);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s ease;
  pointer-events: none;
}

.profile-menu.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-menu {
  position: absolute;
  bottom: 100%;
  left: 8px;
  margin-bottom: 10px;
  width: 200px;
  background: rgba(15, 15, 20, 0.95);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s ease;
  pointer-events: none;
}

.profile-menu.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (min-width: 769px) {
  .toggle-sidebar {
    left: calc(var(--sidebar-width) + 10px);
  }

  .sidebar.collapsed+.toggle-sidebar {
    left: calc(var(--sidebar-collapsed-width) + 10px);
  }
}

.auth-toast {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(96, 165, 250, 0.3);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.2s;
  color: #fff;
}

.auth-toast.show {
  opacity: 1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Form groups */
.form-group {
  margin-bottom: 20px;
}

.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: white;
  font-size: 14px;
  outline: none;
  transition: 0.2s ease;
}

.form-group select:focus,
.form-group textarea:focus {
  border-color: #3b82f6;
}

/* Toggle switch */
.toggle-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  background: #444;
  border-radius: 24px;
  inset: 0;
  transition: 0.3s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked+.slider {
  background: #3b82f6;
}

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

/* Save button */
.save-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.save-btn:hover {
  transform: translateY(-2px);
}

.history-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.history-modal-content {
  width: 600px;
  max-height: 80vh;
  background: rgba(20, 20, 25, 0.9);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.history-full-list {
  overflow-y: auto;
}

.history-full-item {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: 0.2s;
}

.history-full-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.history-left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.history-title {
  font-weight: 500;
}

.history-meta {
  font-size: 12px;
  opacity: 0.6;
}

/* ===== WELCOME CHIPS V2 ===== */
.suggested-prompts {
  margin-top: 30px;
  gap: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  visibility: visible;
  opacity: 1;
  z-index: 10;
}

.prompt-chip {
  position: relative;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: fit-content;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  gap: 8px;
}

.prompt-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(120deg,
      rgba(120, 80, 255, 0.3),
      rgba(0, 200, 255, 0.2),
      transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.prompt-chip:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.prompt-chip:hover::before {
  opacity: 1;
}

/* Ensure the welcome text container doesn't hide chips */
.welcome-text {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 200px !important;
  text-align: center !important;
}

/* plus dropdown */
.file-upload-wrapper .dropdown-menu {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-upload-wrapper .dropdown-item {
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
}

.file-upload-wrapper .dropdown-item:hover {
  background: var(--color-bg-hover);
}

/* Premium density mode - optional */
@media (min-width: 1024px) {
  .sidebar {
    width: 220px;
  }

  .nav-item,
  .history-item {
    padding: 5px 8px;
    font-size: 12.5px;
    margin: 1px 4px;
  }

  .nav-icon {
    font-size: 14px;
    width: 20px;
  }

  .logo-area {
    padding: 14px 10px;
    gap: 6px;
  }

  .logo-area i,
  .logo-img {
    width: 24px;
    height: 24px;
  }

  .profile-area {
    padding: 8px 10px;
    margin: 4px;
  }
}

/* Additional mobile fixes */
@media (max-width: 768px) {
  .chat-container {
    height: calc(100vh - 60px);
    /* Adjust based on your header height */
  }

  .messages {
    padding-bottom: 80px;
    /* Ensure space for input on mobile */
  }

  .input-area {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-border);
  }
}

/* CRITICAL MOBILE FIXES */
@media (max-width: 768px) {

  /* Fix main container */
  .main {
    height: 100dvh;
    overflow: hidden;
  }

  /* Fix chat view on mobile */
  .view-chat {
    height: 100%;
    overflow: hidden;
  }

  /* Fix messages container on mobile */
  .messages {
    padding: 12px 12px 16px 12px !important;
  }

  /* Welcome text on mobile - higher up */
  .view-chat.idle .messages {
    padding-top: 5vh !important;
    /* Less top space on mobile */
  }

  .welcome-text {
    min-height: 80px !important;
    font-size: 22px !important;
    margin-top: 10px !important;
  }

  /* Suggested prompts closer to input */
  .suggested-prompts {
    margin: 10px 0 15px !important;
    gap: 8px !important;
  }

  .prompt-chip {
    padding: 8px 16px !important;
    font-size: 13px !important;
  }

  /* Input area adjustments */
  .input-area {
    padding: 10px 16px !important;
    background: rgba(0, 0, 0, 0.95);
  }

  /* Hide scroll buttons that might block view */
  .scroll-bottom-btn {
    bottom: 80px !important;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .view-chat.idle .messages {
    padding-top: 3vh !important;
  }

  .welcome-text {
    min-height: 60px !important;
    font-size: 20px !important;
  }

  .suggested-prompts {
    margin: 5px 0 10px !important;
  }

  .prompt-chip {
    padding: 6px 12px !important;
    font-size: 12px !important;
  }
}

.danger-btn {
  background: #991b1b;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: 0.2s ease;
}

.danger-btn:hover {
  background: #b91c1c;
}

.custom-select {
  position: relative;
  background: #111827;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.select-trigger {
  padding: 10px 14px;
  color: #e5e7eb;
}

.select-options {
  position: absolute;
  width: 100%;
  background: #0f172a;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 6px;
  display: none;
  z-index: 100;
}

.select-option {
  padding: 10px 14px;
  color: #cbd5e1;
}

.select-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.admin-badge {
  background: #ef4444;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  margin-top: 8px;
  text-align: center;
}

.admin-badge.hidden {
  display: none;
}

.admin-badge.visible {
  display: inline-block;
}

/* Upgrade button */
.header-actions {
  margin-left: auto;
}

.upgrade-btn {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
}

.upgrade-btn:hover {
  transform: scale(1.05);
}

/* Pricing Modal */
.pricing-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.pricing-card {
  background: #111;
  padding: 30px;
  border-radius: 20px;
  width: 600px;
  max-width: 95%;
}

.pricing-table {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.plan {
  flex: 1;
  background: #0f0f0f;
  padding: 20px;
  border-radius: 15px;
}

.plan.premium {
  border: 1px solid #6366f1;
}



.close-pricing {
  margin-top: 15px;
  background: transparent;
  color: #aaa;
  border: none;
  cursor: pointer;
}

.pro-badge {
  background: linear-gradient(90deg, #facc15, #f97316);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 6px;
}

/* Upgrade Button - Minimal Monochrome */
.upgrade-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(6px);
}

.upgrade-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Hide in mobile */
@media (max-width: 768px) {
  .header-actions {
    display: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Status indicators */
.status-indicator {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.8;
}

.status-indicator.loading {
  color: #60a5fa;
}

.status-indicator.syncing {
  color: #fbbf24;
}

.status-indicator.error {
  color: #ef4444;
}

/* Disable heavy effects on mobile */
@media (max-width: 768px) {

  #particle-canvas,
  #astro-3d,
  .galaxy-glow,
  .stars-layer {
    display: none !important;
  }
}

/* ===== BLACK & WHITE AESTHETIC MODALS ===== */
.pricing-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.pricing-modal:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.pricing-card {
  background: #111;
  border: 1px solid #333;
  border-radius: 24px;
  padding: 32px;
  max-width: 800px;
  width: 90%;
  color: #eee;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pricing-modal:not(.hidden) .pricing-card {
  transform: scale(1) translateY(0);
}

.pricing-header {
  text-align: center;
  margin-bottom: 32px;
}

.pricing-header h2 {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: #fff;
  text-transform: uppercase;
  border-bottom: 1px solid #333;
  display: inline-block;
  padding-bottom: 8px;
}

.pricing-header p {
  color: #aaa;
  font-size: 16px;
  font-weight: 300;
}

.pricing-plans {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.plan-card {
  flex: 1;
  min-width: 240px;
  background: #1a1a1a;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #333;
  transition: all 0.3s ease;
  filter: grayscale(1);
}

.plan-card:hover {
  border-color: #888;
  transform: translateY(-4px);
  background: #202020;
}

.plan-card h3 {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 12px;
  color: #fff;
  letter-spacing: 0.5px;
}

.plan-card .price {
  font-size: 24px;
  font-weight: 300;
  margin-bottom: 20px;
  color: #ccc;
  border-bottom: 1px dashed #333;
  padding-bottom: 12px;
}

.plan-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.plan-card li {
  padding: 8px 0;
  color: #bbb;
  font-weight: 300;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #2a2a2a;
}

.plan-card li:last-child {
  border-bottom: none;
}

.plan-card li::before {
  content: "—";
  color: #666;
  font-weight: 300;
}

.premium-btn,
.close-pricing {
  background: transparent;
  border: 1px solid #666;
  color: #fff;
  padding: 12px 24px;
  border-radius: 40px;
  font-weight: 400;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 14px;
}

.premium-btn:hover,
.close-pricing:hover {
  background: #fff;
  color: #111;
  border-color: #fff;
}

.close-pricing {
  margin-top: 16px;
  background: #222;
  border-color: #444;
}

.close-pricing:hover {
  background: #444;
  color: #fff;
  border-color: #444;
}

/* Premium Success Overlay – Black & White */
.premium-success {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.premium-success:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.premium-success-card {
  background: #111;
  border: 1px solid #333;
  border-radius: 32px;
  padding: 48px;
  text-align: center;
  color: #fff;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 400px;
  width: 90%;
}

.premium-success:not(.hidden) .premium-success-card {
  transform: scale(1);
}

.premium-success .success-icon {
  width: 80px;
  height: 80px;
  background: #222;
  border: 2px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 24px;
  color: #fff;
  animation: subtlePop 0.5s ease;
}

@keyframes subtlePop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

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

.premium-success h2 {
  font-size: 28px;
  font-weight: 300;
  margin-bottom: 12px;
  letter-spacing: 1px;
  color: #fff;
}

.premium-success p {
  color: #aaa;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .toggle-sidebar {
    display: flex;
  }
}

.suggestions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 700px;
}

.suggestion-chip {
  padding: 12px 22px;
  font-size: 15px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.suggestion-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-3px) scale(1.04);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Ambient glow */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(120, 80, 255, 0.15), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(0, 200, 255, 0.12), transparent 40%);
  pointer-events: none;
  z-index: -1;
}

/* Explore prompts grid */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.explore-card {
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #e0e0e0;
  font-size: 14px;
  backdrop-filter: blur(8px);
}

.explore-card:hover {
  transform: translateY(-3px);
  border-color: #6366f1;
  background: rgba(30, 30, 30, 0.9);
}

.explore-card.premium-locked {
  opacity: 0.6;
  filter: grayscale(0.8);
  position: relative;
}

.explore-card.premium-locked::after {
  content: "🔒";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
}

.explore-section {
  margin-bottom: 40px;
}

.explore-section h3 {
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: #f0f0f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.comparison-table {
  background: rgba(15, 15, 20, 0.7);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
  color: #ddd;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.comparison-table th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: white;
}

.comparison-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.premium-locked {
  filter: blur(4px);
  position: relative;
}

.premium-locked::after {
  content: "PRO";
  position: absolute;
  top: 8px;
  right: 8px;
  background: #6366f1;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: bold;
}

.explore-card .locked-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: #ccc;
}

.explore-card .locked-sub {
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.explore-card.premium-locked {
  cursor: pointer;
  background: rgba(30, 30, 35, 0.6);
  border-color: rgba(255, 215, 0, 0.2);
  transition: all 0.2s ease;
}

.explore-card.premium-locked:hover {
  background: rgba(40, 40, 45, 0.8);
  border-color: #fbbf24;
}

/* Ensure the locked cards don't show the raw text */
.explore-card.premium-locked .locked-title,
.explore-card.premium-locked .locked-sub {
  pointer-events: none;
}

.explore-card {
  position: relative;
  background: rgba(20, 20, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 18px;
  border-radius: 16px;
  transition: 0.25s ease;
  cursor: pointer;
  overflow: hidden;
}

.explore-card:hover {
  transform: translateY(-4px);
  border-color: #6366f1;
}

.explore-card.locked {
  user-select: none;
  pointer-events: auto;
}

.card-title {
  font-weight: 600;
  font-size: 15px;
}

.card-sub {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 6px;
}

.blur-overlay {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
}

.lock-badge {
  background: #6366f1;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.input-area {
  padding: 18px;
  background: linear-gradient(to top, #0a0a0a 40%, transparent);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 14px 18px;
  border-radius: 24px;

  background: rgba(30, 30, 30, 0.7);
  backdrop-filter: blur(14px);

  border: none;

  transition: all 0.25s ease;
}

.input-wrapper:focus-within {
  border-color: rgba(255,255,255,0.08);
}

#messageInput {
  flex: 1;
  background: transparent;
  border: none;
  resize: none;

  font-size: 15px;
  line-height: 1.5;
  color: white;

  outline: none;
  max-height: 160px;
}

#messageInput::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.input-icon {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 15px;
  transition: 0.2s ease;
}

.input-icon:hover {
  color: #6366f1;
}

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;

  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;

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

  cursor: pointer;
  transition: all 0.25s ease;
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.send-btn:active {
  transform: scale(0.95);
}

.welcome-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px 20px;
}

.welcome-content {
  max-width: 720px;
}

#welcome-title {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #ffffff, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#welcome-subtitle {
  font-size: 18px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.3px;
  margin-bottom: 40px;
}

#welcome-title {
  text-shadow: 0 10px 40px rgba(99, 102, 241, 0.2);
}

.view-explore {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 40px 60px;
  box-sizing: border-box;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.explore-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: white;
}

.explore-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-card {
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.auth-card h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 30px;
  text-align: center;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #111;
  color: white;
  font-size: 14px;
}

.auth-input:focus {
  outline: none;
  border-color: white;
}

.auth-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: white;
  color: black;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.auth-btn:hover {
  opacity: 0.85;
}

.auth-close {
  position: absolute;
  top: 18px;
  right: 22px;
  cursor: pointer;
  color: #aaa;
}

/* ===== AUTH MODAL – BLACK/WHITE ===== */
.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-modal.hidden {
  display: none;
}

.auth-card {
  width: 380px;
  padding: 40px;
  border-radius: 20px;
  background: #0b0b0b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
  position: relative;
}

.auth-card h2 {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 30px;
  color: white;
}

.auth-input {
  width: 100%;
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #111;
  color: white;
  font-size: 14px;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: white;
  color: black;
  font-weight: 600;
  border: none;
  cursor: pointer;
  margin-bottom: 10px;
}

.auth-btn.secondary {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-close {
  position: absolute;
  right: 18px;
  top: 18px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
}

/* Ensure explore view scrolls */
.view-explore {
  overflow-y: auto;
  height: 100%;
  padding-bottom: 40px;
}

/* ========================================= */
/* ChatGPT UI Enhancements (Mobile & History) */
/* ========================================= */

/* Mobile Header - ChatGPT Style (Minimal) */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: transparent;
  /* transparent for minimal look */
  height: 50px;
  /* slightly shorter */
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  box-sizing: border-box;
}

.mobile-left,
.mobile-right {
  display: flex;
  align-items: center;
  width: 44px;
  /* fixed width for balance */
}

.mobile-right {
  justify-content: flex-end;
}

.mobile-icon-btn {
  background: transparent;
  border: none;
  color: #ececf1;
  font-size: 20px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
}

.mobile-icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mobile-title {
  font-size: 17px;
  font-weight: 500;
  color: #ececf1;
}

/* History Aesthetics */
.history-item {
  padding: 12px 14px !important;
  margin: 4px 8px !important;
  border-radius: 8px !important;
  transition: background 0.2s ease !important;
  color: #ececf1 !important;
  font-size: 14.5px !important;
  border: none !important;
  background: transparent;
}

.history-item:hover {
  background: #2a2b32 !important;
}

.history-item.active {
  background: #2a2b32 !important;
}

.history-item .nav-icon {
  font-size: 15px;
  color: #8e8ea0;
}

.history-item .timestamp {
  font-size: 11px;
  color: #71717a;
  margin-left: auto;
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    position: fixed;
    z-index: 2000;
  }

  .sidebar.hidden {
    transform: translateX(-100%);
  }

  .grok-bar,
  #desktopHeader {
    display: none !important;
  }

  .premium-badge {
    display: none !important;
  }

  /* Prevent collision with absolute mobile header */
  .view-settings,
  .view-explore {
    padding-top: 64px !important;
  }
}