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

html,
body {
  min-height: 100vh;
}

body {
  overflow-y: auto;

  font-family: Inter, Arial, Helvetica, sans-serif;

  color: white;

  background:
    radial-gradient(circle at top left, rgba(212,175,55,0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.05), transparent 22%),
    linear-gradient(135deg, #050505, #0d0d0d, #131313);
}

.bg-glow {
  position: fixed;

  width: 420px;
  height: 420px;

  border-radius: 50%;

  filter: blur(100px);

  opacity: 0.16;

  pointer-events: none;
}

.glow-1 {
  background: #d4af37;

  top: -120px;
  left: -120px;
}

.glow-2 {
  background: #ffffff;

  bottom: -160px;
  right: -120px;
}

.app {
  position: relative;

  z-index: 2;

  min-height: 100vh;

  display: grid;

  grid-template-columns: 300px 1fr;

  gap: 24px;

  padding: 24px;
}

.sidebar,
.chat-container {
  border-radius: 34px;

  border: 1px solid rgba(255,255,255,0.08);

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

  backdrop-filter: blur(24px);

  box-shadow:
    0 30px 90px rgba(0,0,0,0.45);

  overflow: hidden;
}

.sidebar {
  padding: 22px;

  display: flex;
  flex-direction: column;

  gap: 22px;
}

.logo {
  display: flex;
  align-items: center;

  gap: 14px;
}

.logo-icon {
  width: 58px;
  height: 58px;

  border-radius: 18px;

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

  font-size: 24px;
  font-weight: bold;

  color: #111;

  background:
    linear-gradient(
      135deg,
      #fff4bf,
      #d4af37,
      #fff7d1
    );

  box-shadow:
    0 10px 30px rgba(212,175,55,0.25);
}

.logo h2 {
  font-size: 26px;
  font-weight: 800;
}

.logo p {
  color: rgba(255,255,255,0.48);

  margin-top: 2px;

  font-size: 14px;
}

.card {
  padding: 18px;

  border-radius: 26px;

  background: rgba(255,255,255,0.03);

  border: 1px solid rgba(255,255,255,0.05);

  display: flex;
  flex-direction: column;

  gap: 14px;
}

.card h3 {
  color: #f4e3a1;

  margin-bottom: 6px;
}

.suggestion {
  border: 1px solid rgba(255,255,255,0.06);

  padding: 16px;

  border-radius: 18px;

  color: rgba(255,255,255,0.88);

  cursor: pointer;

  text-align: left;

  background: rgba(255,255,255,0.03);

  transition: 0.2s ease;

  font-weight: 600;
}

.suggestion:hover {
  transform: translateY(-2px);

  border-color: rgba(212,175,55,0.35);

  background: rgba(212,175,55,0.06);
}

.mini-card {
  margin-top: auto;

  display: flex;
  align-items: center;

  gap: 10px;

  padding: 16px;

  border-radius: 20px;

  background: rgba(255,255,255,0.03);

  border: 1px solid rgba(255,255,255,0.05);
}

.status-dot {
  width: 10px;
  height: 10px;

  border-radius: 50%;

  background: #d4af37;

  box-shadow:
    0 0 18px rgba(212,175,55,0.8);
}

.chat-container {
  display: grid;

  grid-template-rows: auto minmax(0, 1fr) auto;

  height: calc(100vh - 48px);

  min-height: 0;
}

.chat-header {
  padding: 24px;

  border-bottom: 1px solid rgba(255,255,255,0.06);

  display: flex;
  align-items: center;

  gap: 16px;
}

.avatar {
  width: 64px;
  height: 64px;

  border-radius: 22px;

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

  font-size: 28px;

  color: #111;

  background:
    linear-gradient(
      135deg,
      #fff4bf,
      #d4af37,
      #fff7d1
    );

  box-shadow:
    0 10px 30px rgba(212,175,55,0.22);
}

.chat-header h1 {
  font-size: 30px;
  font-weight: 800;
}

.chat-header p {
  color: rgba(255,255,255,0.45);

  margin-top: 4px;
}

.messages {
  min-height: 0;

  height: auto;

  overflow-y: auto;

  padding: 28px;

  padding-bottom: 40px;

  display: flex;
  flex-direction: column;

  gap: 18px;

  scroll-behavior: smooth;
}

.messages::-webkit-scrollbar {
  width: 7px;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(212,175,55,0.3);

  border-radius: 999px;
}

.msg {
  max-width: 72%;

  padding: 18px 20px;

  border-radius: 24px;

  line-height: 1.6;

  white-space: pre-wrap;

  animation: pop 0.2s ease;
}

@keyframes pop {

  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

.bot {
  align-self: flex-start;

  background:
    rgba(255,255,255,0.05);

  border:
    1px solid rgba(255,255,255,0.06);

  color:
    rgba(255,255,255,0.92);

  border-top-left-radius: 8px;
}

.user {
  align-self: flex-end;

  color: #111;

  background:
    linear-gradient(
      135deg,
      #fff4bf,
      #d4af37
    );

  box-shadow:
    0 12px 30px rgba(212,175,55,0.16);

  border-top-right-radius: 8px;
}

.composer {
  position: relative;

  z-index: 5;

  display: grid;

  grid-template-columns: 1fr auto;

  gap: 14px;

  padding: 24px;

  border-top:
    1px solid rgba(255,255,255,0.05);

  background:
    rgba(10,10,10,0.72);

  backdrop-filter: blur(18px);
}

input {
  border:
    1px solid rgba(255,255,255,0.06);

  outline: none;

  padding: 18px 22px;

  border-radius: 22px;

  color: white;

  font-size: 15px;

  background:
    rgba(255,255,255,0.04);
}

input::placeholder {
  color:
    rgba(255,255,255,0.36);
}

.composer button {
  width: 64px;

  border: none;

  border-radius: 22px;

  cursor: pointer;

  color: #111;

  font-size: 24px;
  font-weight: bold;

  background:
    linear-gradient(
      135deg,
      #fff4bf,
      #d4af37,
      #fff7d1
    );

  box-shadow:
    0 10px 25px rgba(212,175,55,0.22);

  transition: 0.2s ease;
}

.composer button:hover {
  transform: scale(1.05);
}

@media (max-width: 950px) {

  body {
    overflow-y: auto;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .chat-container {
    min-height: 720px;
  }
}
.mode-selector {
  display: flex;
  gap: 10px;
}

.mode-btn {
  flex: 1;

  border: 1px solid rgba(255,255,255,0.08);

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

  color: rgba(255,255,255,0.75);

  padding: 14px;

  border-radius: 18px;

  cursor: pointer;

  font-weight: 700;

  transition: 0.25s ease;
}

.mode-btn:hover {
  border-color: rgba(212,175,55,0.35);

  background: rgba(212,175,55,0.08);

  color: white;
}

.mode-btn.active {
  background:
    linear-gradient(
      135deg,
      #fff4bf,
      #d4af37,
      #fff7d1
    );

  color: #111;

  border-color: transparent;

  box-shadow:
    0 10px 25px rgba(212,175,55,0.22);
}

.new-chat-btn {
  border: none;

  padding: 16px;

  border-radius: 20px;

  cursor: pointer;

  font-size: 15px;
  font-weight: 700;

  color: #111;

  background:
    linear-gradient(
      135deg,
      #fff4bf,
      #d4af37,
      #fff7d1
    );

  box-shadow:
    0 10px 25px rgba(212,175,55,0.18);

  transition: 0.2s ease;
}

.new-chat-btn:hover {
  transform: translateY(-2px) scale(1.01);

  box-shadow:
    0 14px 32px rgba(212,175,55,0.24);
}
.clear-memory-btn {
  border: 1px solid rgba(255,255,255,0.06);
  padding: 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.82);
  background: rgba(255,255,255,0.035);
  transition: 0.2s ease;
}

.clear-memory-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(212,175,55,0.35);
  background: rgba(212,175,55,0.06);
}
.chat-history {
  padding: 16px;
  border-radius: 24px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.chat-history h3 {
  color: #f4e3a1;
  margin-bottom: 12px;
  font-size: 16px;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-item {
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.82);
  padding: 12px;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  transition: 0.2s ease;
}

.chat-item:hover,
.chat-item.active {
  background: rgba(212,175,55,0.08);
  border-color: rgba(212,175,55,0.35);
  color: white;
}

.auth-card,
.user-card {
  display: flex;

  flex-direction: column;

  gap: 12px;

  padding: 18px;

  border-radius: 24px;

  background: rgba(255,255,255,0.03);

  border: 1px solid rgba(255,255,255,0.05);
}

.auth-card h3,
.user-card h3 {
  color: #f4e3a1;

  font-size: 16px;
}

.auth-card input {
  width: 100%;

  padding: 14px;

  border-radius: 16px;

  border: 1px solid rgba(255,255,255,0.06);

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

  color: white;

  outline: none;
}

.auth-card input::placeholder {
  color: rgba(255,255,255,0.45);
}

.auth-btn {
  border: none;

  padding: 14px;

  border-radius: 16px;

  cursor: pointer;

  font-weight: 700;

  color: #111;

  background:
    linear-gradient(
      135deg,
      #fff4bf,
      #d4af37,
      #fff7d1
    );

  transition: 0.2s ease;
}

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

.auth-btn.secondary {
  background: rgba(255,255,255,0.06);

  color: white;

  border: 1px solid rgba(255,255,255,0.08);
}

.hidden {
  display: none;
}

#userEmail {
  color: rgba(255,255,255,0.82);

  font-size: 14px;

  word-break: break-word;
}

.toast {
  position: fixed;

  top: 30px;
  right: 30px;

  min-width: 320px;

  padding: 18px 22px;

  border-radius: 20px;

  background:
    linear-gradient(
      135deg,
      rgba(20,20,20,0.96),
      rgba(35,35,35,0.96)
    );

  border: 1px solid rgba(255,255,255,0.08);

  color: white;

  font-weight: 600;

  backdrop-filter: blur(20px);

  box-shadow:
    0 15px 50px rgba(0,0,0,0.45);

  opacity: 0;

  transform: translateY(-20px);

  pointer-events: none;

  transition: 0.3s ease;

  z-index: 999999;
}

.toast.show {
  opacity: 1;

  transform: translateY(0);
}

.toast.success {
  border-color: rgba(76, 255, 145, 0.35);
}

.toast.error {
  border-color: rgba(255, 95, 95, 0.35);
}
.chat-header {
  justify-content: space-between;
}

.chat-heading {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-auth-btn {
  border: 1px solid rgba(255,255,255,0.08);
  padding: 14px 20px;
  border-radius: 18px;
  cursor: pointer;
  color: #111;
  font-weight: 800;
  background: linear-gradient(135deg, #fff4bf, #d4af37, #fff7d1);
  box-shadow: 0 10px 25px rgba(212,175,55,0.22);
  transition: 0.2s ease;
}

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

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(18px);
}

.auth-modal-card {
  position: relative;
  width: min(430px, 92vw);
  padding: 24px;
  border-radius: 30px;
  background: rgba(18,18,18,0.94);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 30px 90px rgba(0,0,0,0.55);
}

.auth-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  cursor: pointer;
  color: white;
  font-size: 24px;
  background: rgba(255,255,255,0.05);
}

.auth-card,
.user-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card h3,
.user-card h3 {
  color: #f4e3a1;
  font-size: 22px;
}

.auth-text {
  color: rgba(255,255,255,0.58);
  line-height: 1.5;
  margin-bottom: 4px;
}

.auth-card input {
  width: 100%;
  padding: 15px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: white;
  outline: none;
}

.auth-card input::placeholder {
  color: rgba(255,255,255,0.42);
}

.auth-btn {
  border: none;
  padding: 15px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
  color: #111;
  background: linear-gradient(135deg, #fff4bf, #d4af37, #fff7d1);
  transition: 0.2s ease;
}

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

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

.hidden {
  display: none !important;
}

#userEmail {
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  word-break: break-word;
}
.image-upload-btn {
  width: 64px;
  height: 64px;

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

  border-radius: 22px;

  cursor: pointer;

  font-size: 24px;

  color: #111;

  background:
    linear-gradient(
      135deg,
      #fff4bf,
      #d4af37,
      #fff7d1
    );

  box-shadow:
    0 10px 25px rgba(212,175,55,0.22);

  transition: 0.2s ease;
}

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

.image-preview {
  max-width: 260px;
  border-radius: 18px;
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}

.image-upload-btn {
  width: 64px;
  height: 64px;

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

  border-radius: 22px;

  cursor: pointer;

  font-size: 24px;

  color: #111;

  background:
    linear-gradient(
      135deg,
      #fff4bf,
      #d4af37,
      #fff7d1
    );

  box-shadow:
    0 10px 25px rgba(212,175,55,0.22);

  transition: 0.2s ease;
}

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

.image-preview {
  max-width: 260px;

  border-radius: 18px;

  margin-top: 10px;

  border:
    1px solid rgba(255,255,255,0.08);

  box-shadow:
    0 10px 30px rgba(0,0,0,0.25);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.premium-btn {
  border: none;

  padding: 14px 22px;

  border-radius: 18px;

  cursor: pointer;

  font-weight: 800;

  color: #111;

  background:
    linear-gradient(
      135deg,
      #ffe27a,
      #d4af37,
      #fff4bf
    );

  box-shadow:
    0 12px 30px rgba(212,175,55,0.25);

  transition: 0.2s ease;
}

.premium-btn:hover {
  transform:
    translateY(-2px)
    scale(1.02);
}
@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app {
    min-height: 100vh;
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 14px;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    padding: 20px;
    border-radius: 26px;
  }

  .logo {
    margin-bottom: 18px;
  }

  .logo h2 {
    font-size: 28px;
  }

  .mode-selector {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .mode-btn,
  .new-chat-btn,
  .clear-memory-btn {
    width: 100%;
    min-height: 54px;
    font-size: 15px;
  }

  .chat-history,
  .card {
    max-height: none;
  }

  .chat-container {
    min-height: 75vh;
    border-radius: 26px;
  }

  .chat-header {
    padding: 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .chat-heading {
    width: 100%;
  }

  .avatar {
    width: 58px;
    height: 58px;
    min-width: 58px;
  }

  #chatTitle {
    font-size: 30px;
  }

  #chatSubtitle {
    font-size: 15px;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .premium-btn,
  .top-auth-btn {
    width: 100%;
    padding: 14px 12px;
    font-size: 14px;
  }

  .messages {
    padding: 16px;
    max-height: 58vh;
    overflow-y: auto;
  }

  .msg {
    max-width: 92%;
    font-size: 15px;
    padding: 14px;
  }

  .composer {
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    padding: 12px;
  }

  .composer input {
    min-width: 0;
    height: 56px;
    font-size: 15px;
  }

  .image-upload-btn,
  .composer button {
    width: 56px;
    height: 56px;
    min-width: 56px;
    padding: 0;
    border-radius: 18px;
  }

  .image-preview {
    max-width: 220px;
  }

  .auth-modal-card {
    width: calc(100vw - 28px);
    border-radius: 26px;
  }

  .toast {
    top: 16px;
    right: 14px;
    left: 14px;
    min-width: auto;
  }
}

@media (max-width: 520px) {
  .app {
    padding: 10px;
  }

  .sidebar {
    padding: 16px;
  }

  .logo {
    gap: 12px;
  }

  .logo-icon {
    width: 58px;
    height: 58px;
    min-width: 58px;
  }

  .logo h2 {
    font-size: 24px;
  }

  .card,
  .chat-history,
  .mini-card {
    border-radius: 22px;
  }

  #chatTitle {
    font-size: 26px;
  }

  .header-actions {
    grid-template-columns: 1fr;
  }

  .messages {
    max-height: 56vh;
  }

  .composer {
    grid-template-columns: 1fr auto;
  }

  .image-upload-btn {
    order: 2;
  }

  .composer button {
    order: 3;
  }

  .composer input {
    grid-column: 1 / -1;
  }
}