
:root {
  --bg: #090812;
  --panel: #100e1d;
  --card: #171426;
  --purple: #8b35ff;
  --purple-light: #bd78ff;
  --text: #f5efff;
  --muted: #9991ad;
  --border: #ffffff14;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* HEADER */

header {
  height: 66px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: #100e1d;
  border-bottom: 1px solid var(--border);
  z-index: 5;
}

.logo {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #6720d9, #bd50ff);
  font-size: 25px;
  font-weight: bold;
  box-shadow: 0 0 18px #9b36ff55;
}

.brand {
  font-weight: 800;
  letter-spacing: 3px;
  font-size: 17px;
}

.status {
  font-size: 10px;
  color: #55e99b;
  margin-top: 4px;
}

.menu,
.new-chat {
  background: transparent;
  color: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 15px;
}

.menu {
  font-size: 21px;
  border: none;
}

.new-chat {
  margin-left: auto;
  background: #7929dc33;
  border-color: #9c4aff66;
}

/* APP LAYOUT */

.app-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* SIDEBAR */

.sidebar {
  position: fixed;
  top: 0;
  left: -290px;
  bottom: 0;
  width: 270px;
  padding: 24px 16px;
  background: #100d1c;
  border-right: 1px solid #9a48ff44;
  z-index: 20;
  transition: left .3s ease;
}

.sidebar.open {
  left: 0;
}

.sidebar h3 {
  margin: 35px 0 22px;
  letter-spacing: 2px;
  font-size: 14px;
  color: var(--purple-light);
}

.side-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  color: white;
  border: none;
  font-size: 22px;
}

.side-item {
  width: 100%;
  text-align: left;
  padding: 14px;
  margin: 5px 0;
  border-radius: 10px;
  background: #ffffff08;
  border: 1px solid var(--border);
  color: white;
  font-size: 14px;
}

.side-item:active {
  background: #7626ce55;
}

.sidebar-footer {
  position: absolute;
  bottom: 25px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  letter-spacing: 2px;
  color: var(--purple-light);
}

.sidebar-footer small {
  color: var(--muted);
  letter-spacing: 0;
}

.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #0009;
  z-index: 15;
}

.menu-overlay.show {
  display: block;
}

/* STUDIO SHORTCUTS */

.studio-bar {
  display: flex;
  gap: 10px;
  padding: 12px;
  overflow-x: auto;
}

.studio-btn {
  flex: 1;
  min-width: 125px;
  padding: 11px;
  border-radius: 12px;
  color: #e9d5ff;
  background: #211333;
  border: 1px solid #a44aff55;
  font-size: 12px;
}

/* CHAT */

#chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 15px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.welcome {
  margin: auto;
  text-align: center;
  padding: 25px 10px;
}

.symbol {
  color: var(--purple-light);
  font-size: 55px;
  margin-bottom: 18px;
  text-shadow: 0 0 25px #9c36ff;
}

.welcome h2 {
  font-size: 20px;
  letter-spacing: 2px;
}

.welcome p {
  color: var(--muted);
  line-height: 1.7;
  margin-top: 12px;
  font-size: 14px;
}

.message {
  max-width: 85%;
  padding: 12px 15px;
  border-radius: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #6427d9, #922eea);
  border: 1px solid #a15aff55;
  border-bottom-right-radius: 5px;
}

.message.bot {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}

/* COMPOSER */

.composer {
  padding: 12px 14px 15px;
  background: #100e1d;
  border-top: 1px solid var(--border);
}

.tools {
  margin-bottom: 10px;
}

.tool {
  display: inline-block;
  color: var(--purple-light);
  font-size: 13px;
  padding: 8px 12px;
  background: #7929dc22;
  border: 1px solid #9c4aff55;
  border-radius: 10px;
}

.inputrow {
  display: flex;
  gap: 9px;
}

.inputrow input {
  flex: 1;
  min-width: 0;
  background: #191629;
  border: 1px solid #ffffff20;
  border-radius: 22px;
  color: white;
  padding: 14px 17px;
  outline: none;
  font-size: 14px;
}

.inputrow input:focus {
  border-color: var(--purple);
}

.inputrow input::placeholder {
  color: #89819d;
}

.send {
  width: 47px;
  height: 47px;
  border: none;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, #7929dc, #b34cff);
  font-size: 20px;
  box-shadow: 0 0 16px #922eea55;
}

/* VOICE ORB */

.voice {
  display: block;
  width: 58px;
  height: 58px;
  margin: 16px auto 7px;
  border: 2px solid #c17aff;
  border-radius: 50%;
  background: radial-gradient(circle, #a53aff, #32105f);
  color: white;
  font-size: 27px;
  box-shadow: 0 0 15px #9b36ff, 0 0 35px #9b36ff55;
  animation: orbGlow 2s infinite alternate;
}

@keyframes orbGlow {
  from {
    box-shadow: 0 0 12px #9b36ff;
  }
  to {
    box-shadow: 0 0 28px #bd78ff, 0 0 48px #9b36ff77;
  }
}

#voiceStatus {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

/* IMAGE PREVIEW */

.attachment-preview {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 8px;
}

.attachment-preview img {
  width: 75px;
  height: 75px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--purple);
}

/* MOBILE */

@media (min-width: 700px) {
  .main-content {
    max-width: 1000px;
    margin: auto;
    width: 100%;
  }
}

@media (max-width: 380px) {
  header {
    padding: 0 9px;
    gap: 7px;
  }

  .brand {
    font-size: 14px;
  }

  .new-chat {
    padding: 8px;
    font-size: 12px;
  }
}
