/* ---------------------------------------------------------
   QUANTUM CORE (Variables + Resets)
   --------------------------------------------------------- */
:root {
  --bg-0: #010409;
  --bg-1: #0A0F1A;
  --bg-2: #111827;
  --glass: rgba(255,255,255,0.06);

  --accent-1: #3B82F6;
  --accent-2: #60A5FA;
  --accent-3: #93C5FD;

  --text-1: #F8FAFC;
  --text-2: #CBD5E1;
  --text-3: #64748B;

  --border: rgba(148,163,184,0.18);
  --shadow-1: 0 20px 60px rgba(0,0,0,0.55);

  --radius: 18px;
  --transition: 0.25s ease;
}

/* GLOBAL RESET */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: "Inter", sans-serif;
}

/* ---------------------------------------------------------
   PAGE BACKGROUND (replaces style.css)
   --------------------------------------------------------- */
body.dashboard-body {
  background: var(--bg-0);
  color: var(--text-1);
}

/* ---------------------------------------------------------
   MAIN CONTENT WRAPPER (replaces style.css)
   --------------------------------------------------------- */
.main-content {
  margin-left: 0;
  padding: 40px;
}

/* ---------------------------------------------------------
   CHAT PAGE WRAPPER
   --------------------------------------------------------- */
.chat-page {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 20px;
    padding-top: 110px; /* space under top-nav */
}

/* ---------------------------------------------------------
   PAGE HEADER
   --------------------------------------------------------- */
.chat-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fade-in 0.6s ease;
}

.chat-header h1 {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent-2), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.chat-header p {
    font-size: 17px;
    color: var(--text-2);
    margin-top: 6px;
}

/* ---------------------------------------------------------
   CHAT CONTAINER
   --------------------------------------------------------- */
.chat-container {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(22px);
    padding: 28px;
    box-shadow: var(--shadow-1);
    animation: fade-in-up 0.6s ease;
}

/* CHAT BOX */
#chat-box {
    max-height: calc(100vh - 340px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-right: 10px;
    scroll-behavior: smooth;
}

/* ---------------------------------------------------------
   CHAT BUBBLES
   --------------------------------------------------------- */
.chat-bubble {
    max-width: 78%;
    padding: 16px 20px;
    border-radius: 18px;
    line-height: 1.55;
    font-size: 15px;
    animation: fade-in-up 0.25s ease;
    backdrop-filter: blur(14px);
}

.user-bubble {
    margin-left: auto;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    box-shadow: 0 0 18px rgba(96,165,250,0.45);
}

.assistant-bubble {
    margin-right: auto;
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-1);
    box-shadow: 0 0 14px rgba(0,0,0,0.25);
}

/* ---------------------------------------------------------
   FLOATING INPUT BAR
   --------------------------------------------------------- */
.chat-input-row {
    margin-top: 26px;
    display: flex;
    gap: 14px;
    align-items: center;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    padding: 14px 18px;
    backdrop-filter: blur(22px);
    box-shadow: var(--shadow-1);
    position: sticky;
    bottom: 20px;
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-1);
    font-size: 15px;
    outline: none;
}

.chat-input::placeholder {
    color: var(--text-3);
}

.send-btn {
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 14px rgba(59,130,246,0.35);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(59,130,246,0.55);
}

/* ---------------------------------------------------------
   LOADER
   --------------------------------------------------------- */
.quantum-pulse {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.quantum-pulse div {
    width: 10px;
    height: 10px;
    background: var(--accent-1);
    border-radius: 50%;
    animation: quantumPulse 0.9s infinite ease-in-out;
}

.quantum-pulse div:nth-child(2) { animation-delay: 0.15s; }
.quantum-pulse div:nth-child(3) { animation-delay: 0.3s; }

@keyframes quantumPulse {
    0% { transform: scale(0.6); opacity: 0.4; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.6); opacity: 0.4; }
}

/* ---------------------------------------------------------
   ANIMATIONS
   --------------------------------------------------------- */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   MOBILE
   --------------------------------------------------------- */
@media (max-width: 768px) {
    .chat-page {
        padding-top: 90px;
    }

    .chat-header h1 {
        font-size: 32px;
    }

    .chat-container {
        padding: 20px;
    }

    #chat-box {
        max-height: calc(100vh - 300px);
    }

    .chat-bubble {
        font-size: 14px;
        padding: 14px 16px;
    }

    .chat-input-row {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .send-btn {
        width: 100%;
    }
}
/* ---------------------------------------------------------
   TOP NAV — Quantum UI (Self‑Contained for Chat Page)
   --------------------------------------------------------- */
.top-nav {
  width: 100%;
  height: 64px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(148,163,184,0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
}

/* LEFT SIDE */
.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #93C5FD; /* accent-3 */
}

/* RIGHT SIDE */
.nav-link {
  color: #CBD5E1; /* text-2 */
  text-decoration: none;
  font-size: 1rem;
  transition: 0.25s ease;
}

.nav-link:hover {
  color: #3B82F6; /* accent-1 */
}

.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
}

/* ---------------------------------------------------------
   HAMBURGER ICON
   --------------------------------------------------------- */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 2000;
}

.hamburger span {
  width: 26px;
  height: 3px;
  background: white;
  border-radius: 3px;
}

/* ---------------------------------------------------------
   MOBILE MENU
   --------------------------------------------------------- */
.mobile-top-menu {
  display: none;
  flex-direction: column;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 20px;
  border-radius: 12px;
  margin: 10px 20px;
}

.mobile-top-menu.show {
  display: flex !important;
}

.mobile-top-menu a {
  padding: 12px 0;
  color: #CBD5E1;
  text-decoration: none;
  font-size: 16px;
  transition: 0.25s ease;
}

.mobile-top-menu a:hover {
  color: white;
}

/* ---------------------------------------------------------
   RESPONSIVE NAV
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .nav-right {
    display: none;
  }

  #hamburger-menu {
    display: none !important;
  }

  .hamburger {
    display: flex !important;
  }
}

@media (max-width: 480px) {
  .nav-title {
    font-size: 1.2rem;
  }

  .nav-avatar {
    width: 32px;
    height: 32px;
  }
}
/* ---------------------------------------------------------
   ADDITIONS — PREMIUM QUANTUM UI ENHANCEMENTS
   --------------------------------------------------------- */

/* Smooth fade-in for new messages */
.fade-in {
    animation: fadeInSmooth 0.35s ease forwards;
}

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

/* Hover micro-interaction for bubbles */
.chat-bubble:hover {
    transform: translateY(-2px);
    transition: 0.25s ease;
}

/* User bubble glow enhancement */
.user-bubble {
    box-shadow: 0 0 22px rgba(96,165,250,0.55);
}

/* Assistant bubble subtle glow */
.assistant-bubble:hover {
    box-shadow: 0 0 18px rgba(255,255,255,0.08);
}

/* Chat container glow when focused */
.chat-container:focus-within {
    box-shadow: 0 0 30px rgba(59,130,246,0.25);
    transition: 0.3s ease;
}

/* Input focus ring */
.chat-input:focus {
    outline: none;
    box-shadow: 0 0 12px rgba(96,165,250,0.35);
    transition: 0.25s ease;
}

/* Send button press animation */
.send-btn:active {
    transform: scale(0.96);
}

/* Typing loader polish */
#typing-loader {
    opacity: 0.8;
    transition: opacity 0.25s ease;
}

/* Quick suggestion buttons */
.chat-suggestions {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    justify-content: center;
    flex-wrap: wrap;
}

.chat-suggestions button {
    padding: 8px 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(14px);
}

.chat-suggestions button:hover {
    background: rgba(255,255,255,0.14);
    color: var(--accent-2);
    border-color: var(--accent-2);
}

/* Clear chat button */
.clear-chat {
    margin-top: 20px;
    text-align: center;
}

.ghost-clear {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.ghost-clear:hover {
    border-color: var(--accent-1);
    color: var(--accent-2);
}

/* Session name styling */
.session-name {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-3);
}

.session-name strong {
    color: var(--accent-3);
}

/* Improved scroll smoothing */
#chat-box {
    scroll-behavior: smooth;
}

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

    .chat-suggestions {
        gap: 8px;
    }

    .chat-suggestions button {
        font-size: 12px;
        padding: 6px 12px;
    }

    .chat-bubble {
        margin-bottom: 4px;
    }

    .ghost-clear {
        width: 100%;
    }
}

@media (max-width: 480px) {

    .chat-header h1 {
        font-size: 28px;
    }

    .chat-suggestions button {
        padding: 6px 10px;
    }

    .chat-bubble {
        font-size: 13px;
        padding: 12px 14px;
    }
}
