* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* BODY */
body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #0b0f19;
  color: white;

  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
header {
  padding: 15px 20px;
  border-bottom: 1px solid #00ffff33;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

#qlasar-title {
  font-size: 129px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -1px;
}

#credits-bar {
  display: flex;
  gap: 14px;

  padding: 10px 16px;

  background: rgba(8, 14, 32, 0.65);
  border: 1px solid rgba(0, 255, 255, 0.25);
  border-radius: 16px;

  backdrop-filter: blur(10px);
  box-shadow: 0 0 22px rgba(0, 255, 255, 0.15);

  align-items: center;
}

.credit-pill {
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 6px 12px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 12px;

  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.2px;

  color: #e6ffff;
}

#qc-count,
#sa-count {
  font-weight: 700;
  color: #00ffff;
}

/* MAIN LAYOUT */
main {
  flex: 1;
  display: flex;
  position: relative;
  min-height: 0;
}

/* CHAT SECTION */
#chat-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* CHAT WINDOW */
#chat-window {
  flex: 1;
  min-height: 0;

  display: flex;
  flex-direction: column;
  gap: 20px;

  overflow-y: auto;
  padding: 20px 16px 100px 16px;
}

/* MESSAGE BUBBLES */
.message {
  padding: 50px 70px;
  max-width: 95%;
  border-radius: 30px;
  line-height: 1.6;
  font-size: 2.1rem;
  word-wrap: break-word;
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

.user {
  background: #00ffff;
  color: black;
  margin-left: auto;
  border-bottom-right-radius: 8px;
  font-weight: 500;
}

.ai {
  background: #1c2233;
  color: #ffffff;
  margin-right: auto;
  border-bottom-left-radius: 8px;
  border: 1px solid #00ffff22;
}

/* FOOTER INPUT BAR */
footer {
  position: sticky;
  bottom: 0;
  background: #0b0f19;
  border-top: 1px solid #00ffff33;
  width: 100%;
  padding: 25px 15px;
}

.input-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  gap: 10px;
}

/* TEXTAREA */
#message-input {
  flex: 1;
  background: #11182a;
  color: white;
  border: 1px solid #1c2233;
  padding: 20px 25px;
  border-radius: 16px;

  font-size: 2.5rem;
  min-height: 80px;
  max-height: 200px;
  line-height: 2.9;
  resize: none;
}

#message-input:focus {
  outline: 1px solid #00ffff;
}

/* SEND BUTTON */
#send-btn {
  background: #00ffff;
  color: black;
  border: none;

  height: 80px;
  padding: 0 30px;

  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.2rem;
  transition: transform 0.1s;
}

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

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;

  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  border-right: 1px solid rgba(0, 255, 255, 0.18);

  padding: 20px 14px;

  display: flex;
  flex-direction: column;
  gap: 14px;

  transition: transform 0.3s ease;
  transform: translateX(-100%);

  z-index: 1000;

  box-shadow: 8px 0 22px rgba(0, 0, 0, 0.4);
}

#sidebar.show {
  transform: translateX(0);
}
  
/* SIDEBAR BUTTONS - REFINED */
#sidebar button {
  width: 100%;
  padding: 18px 16px;

  background: rgba(255, 255, 255, 0.04);
  color: white;

  border: 1px solid rgba(0, 255, 255, 0.18);
  border-radius: 14px;

  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;

  cursor: pointer;

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

  transition: all 0.18s ease-in-out;
}

/* Hover state */
#sidebar button:hover {
  background: rgba(0, 255, 255, 0.12);
  transform: translateX(6px);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.35);
}

/* Active click */
#sidebar button:active {
  background: #00ffff;
  color: black;
  transform: scale(0.98);
}

/* OVERLAY */
#overlay {
  position: fixed;
  inset: 0;
  background: #0006;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}

#overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* VISIBILITY HELPERS */
.hidden { display: none; }
.visible { display: block; }

/* ================= AUTH MODAL ================= */

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

#auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);

  z-index: 100;

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

/* AUTH BOX */
.auth-box {
  position: relative;

  background: #0f172a;
  padding: 26px;
  width: 360px;

  border-radius: 18px;
  border: 1px solid #00ffff33;

  display: flex;
  flex-direction: column;
  gap: 12px;

  box-shadow: 0 0 18px #00ffff33;
}

/* TITLE */
.auth-box h2 {
  text-align: center;
  font-size: 1.6rem;
}

/* INPUTS */
.auth-box input {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: #020617;
  color: white;
  font-size: 1rem;
}

.auth-box input:focus {
  outline: 1px solid #00ffff;
}

/* SUBMIT BUTTON */
#auth-submit {
  padding: 14px;
  border-radius: 12px;
  border: none;

  background: #00ffff;
  color: black;

  font-weight: 700;
  cursor: pointer;
}

/* FLOATING CLOSE BUTTON */
#auth-close {
  position: absolute;
  top: 10px;
  right: 12px;

  width: 32px;
  height: 32px;

  background: #111827;
  color: #ffffff;

  border: 1px solid #334155;
  border-radius: 50%;

  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;

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

  transition: 0.15s ease-in-out;
}

#auth-close:hover {
  background: #00ffff;
  color: #000;
  box-shadow: 0 0 12px #00ffff66;
}

/* TOGGLE LOGIN/SIGNUP TEXT */
#auth-toggle {
  text-align: center;
  font-size: 0.9rem;
}

#auth-toggle span {
  color: #00ffff;
  cursor: pointer;
  font-weight: 600;
}

/* STATUS TEXT */
.auth-status {
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ================= RIGHT SLIDE SAVED SESSIONS PANEL ================= */

#sessions-panel {
  position: fixed;
  top: 90px;
  right: -340px; /* hidden default */

  width: 300px;
  height: 80%;

  padding: 16px;

  background: rgba(8, 14, 32, 0.75);
  border: 1px solid rgba(0, 255, 255, 0.35);

  border-radius: 18px;
  backdrop-filter: blur(10px);

  box-shadow: 0 0 26px rgba(0, 255, 255, 0.25);

  transition: 0.25s ease-in-out;
  z-index: 50;

  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* slide-in state */
#sessions-panel.show {
  right: 10px;
}

/* title */
#sessions-panel h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

/* scroll list container */
#sessions-panel-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* pill/card session item */
.session-pill {
  padding: 10px 12px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 255, 255, 0.25);

  border-radius: 12px;

  cursor: pointer;
  font-size: 0.95rem;

  transition: 0.15s ease;
}

/* hover animation */
.session-pill:hover {
  background: rgba(0, 255, 255, 0.25);
  transform: translateX(4px);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.45);
}

/* ⭐ ACTIVE SESSION HIGHLIGHT */
.session-pill.active-session {
  border: 2px solid #00ffff;
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.55);
  background: rgba(0, 255, 255, 0.15);
  font-weight: 600;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.session-actions {
  display: flex;
  gap: 6px;
}

.session-action-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(0,255,255,0.25);
  border-radius: 8px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: 0.15s ease;
}

.session-action-btn:hover {
  background: rgba(255,0,0,0.35);
}

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

  .auth-box {
    width: 90%;
  }

  #qlasar-title {
    font-size: 64px;
  }

  .message {
    font-size: 1.3rem;
    padding: 24px 28px;
  }

  #sessions-panel {
    width: 92%;
    right: -100%;
  }

  #sessions-panel.show {
    right: 4%;
  }
}
