* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b0c0f;
  --panel: #101116;
  --panel-2: #15171d;
  --border: #252832;
  --text: #f4f4f5;
  --muted: #8b8f99;
  --user: #242731;
  --accent: #ffffff;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}


/* =========================
   APP
========================= */

.app {
  width: 100%;
  height: 100vh;

  display: flex;
  flex-direction: column;

  background:
    radial-gradient(
      circle at 50% -20%,
      #191b22 0%,
      #0b0c0f 45%
    );
}


/* =========================
   HEADER
========================= */

.header {
  height: 64px;
  min-height: 64px;

  padding: 0 22px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid var(--border);

  background: rgba(11, 12, 15, 0.82);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.logo {
  width: 34px;
  height: 34px;

  border-radius: 11px;

  display: grid;
  place-items: center;

  background: #f5f5f5;
  color: #0b0c0f;

  font-weight: 800;
  font-size: 17px;

  box-shadow:
    0 0 20px rgba(255, 255, 255, 0.08);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.status {
  font-size: 10px;
  color: #6f747e;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #8f8f8f;
  padding: 3px 8px;
  margin-top: 3px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  -webkit-border-radius: 20px;
  -moz-border-radius: 20px;
  -ms-border-radius: 20px;
  -o-border-radius: 20px;
}

.status::first-letter {
  color: #aaa;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aaa;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.new-chat {
  border: 1px solid var(--border);

  background: var(--panel);

  color: #b9bdc6;

  padding: 9px 13px;

  border-radius: 10px;

  font-size: 12px;

  cursor: pointer;

  transition:
    0.2s ease;
    background: rgba(255, 255, 255, 0.035);
border: 1px solid rgba(255, 255, 255, 0.09);
color: #ddd;
border-radius: 9px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
transition: all 0.2s ease;
}

.new-chat:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  transform: translateY(-1px);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.2),
    0 0 18px rgba(255, 255, 255, 0.025);
}

.new-chat:active {
  transform: translateY(0) scale(0.97);
}

.new-chat:hover {
  color: white;
  border-color: #444854;
  background: #171920;
}


/* =========================
   CHAT
========================= */

.chat {
  flex: 1;

  width: min(900px, 100%);

  margin: 0 auto;

  padding: 32px 24px 120px;

  overflow-y: auto;

  scroll-behavior: smooth;
}

.chat::-webkit-scrollbar {
  width: 6px;
}

.chat::-webkit-scrollbar-thumb {
  background: #292c34;
  border-radius: 20px;
}

.chat::-webkit-scrollbar-track {
  background: transparent;
}


/* =========================
   WELCOME
========================= */

.welcome {
  min-height: 100%;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  text-align: center;

  padding-bottom: 100px;
}

.welcome-logo {
  width: 64px;
  height: 64px;

  margin-bottom: 20px;

  display: grid;
  place-items: center;

  border-radius: 20px;

  background: #f5f5f5;

  color: #0b0c0f;

  font-size: 30px;
  font-weight: 900;

  box-shadow:
    0 15px 50px rgba(255, 255, 255, 0.08);
}

.welcome h1 {
  font-size: clamp(28px, 5vw, 42px);

  font-weight: 800;

  letter-spacing: -1.5px;

  margin-bottom: 8px;
}

.welcome p {
  color: var(--muted);

  font-size: 14px;
}


/* =========================
   MESSAGE
========================= */

.message {
  display: flex;

  width: 100%;

  margin-bottom: 24px;
}

.message.user {
  justify-content: flex-end;
}

.message.assistant {
  justify-content: flex-start;
}

.bubble {
  max-width: min(720px, 85%);

  padding: 12px 15px;

  border-radius: 16px;

  font-size: 14px;

  line-height: 1.65;

  white-space: pre-wrap;

  word-break: break-word;
}

.message.user .bubble {
  background: var(--user);

  border: 1px solid #30333d;

  border-bottom-right-radius: 5px;
}

.message.assistant .bubble {
  background: transparent;

  border: 0;

  padding-left: 0;

  border-bottom-left-radius: 5px;
}


/* =========================
   TYPING
========================= */

.typing {
  display: flex;

  align-items: center;

  gap: 5px;

  padding: 10px 2px;
}

.typing span {
  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: #858993;

  animation: typing 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {

  0%,
  60%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}


/* =========================
   COMPOSER
========================= */

.composer-wrapper {
  position: fixed;

  left: 50%;

  bottom: 0;

  transform: translateX(-50%);

  width: min(900px, 100%);

  padding: 10px 24px 18px;

  background:
    linear-gradient(
      to top,
      #0b0c0f 65%,
      rgba(11, 12, 15, 0)
    );

  z-index: 20;
}

.composer {
  width: 100%;

  min-height: 58px;

  display: flex;

  align-items: flex-end;

  gap: 9px;

  padding: 7px;

  background: #14161b;

  border: 1px solid #292c35;

  border-radius: 17px;

  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.3);
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tool-button {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;

  background: rgba(255, 255, 255, 0.025);
  color: #aaa;

  cursor: pointer;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    color 0.2s ease;
}

.tool-button:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  transform: translateY(-1px);
}

.tool-button:active {
  transform: scale(0.94);
}


/* =========================
   UPLOAD BUTTON
========================= */

.upload {
  width: 44px;
  min-width: 44px;

  height: 44px;

  border-radius: 13px;

  display: grid;
  place-items: center;

  border: 1px solid #292c35;

  background: #191b21;

  color: #9a9ea7;

  font-size: 24px;

  line-height: 1;

  cursor: pointer;

  user-select: none;

  transition:
    0.2s ease;
}

.upload:hover {
  color: white;

  border-color: #4a4e59;

  background: #202229;
}


/* =========================
   TEXTAREA
========================= */

textarea {
  flex: 1;

  width: 100%;

  min-height: 44px;
  max-height: 180px;

  resize: none;

  overflow-y: auto;

  border: none;
  outline: none;

  background: transparent;

  color: white;

  padding: 11px 5px;

  font-family: inherit;

  font-size: 14px;

  line-height: 22px;
}

textarea::placeholder {
  color: #686c76;
}

textarea::-webkit-scrollbar {
  width: 4px;
}

textarea::-webkit-scrollbar-thumb {
  background: #30333b;
}


/* =========================
   SEND
========================= */

.send {
  width: 44px;
  min-width: 44px;

  height: 44px;

  border: none;

  border-radius: 13px;

  display: grid;
  place-items: center;

  background: white;

  color: #0b0c0f;

  font-size: 22px;
  font-weight: 700;

  cursor: pointer;

  transition:
    0.2s ease;
}

.send:hover {
  transform: translateY(-1px);

  box-shadow:
    0 5px 20px rgba(255, 255, 255, 0.12);
}

.send:active {
  transform: scale(0.95);
}

.send:disabled {
  opacity: 0.35;

  cursor: not-allowed;

  transform: none;

  box-shadow: none;
}


/* =========================
   IMAGE
========================= */

.selected-image {
  width: 100%;

  display: flex;

  justify-content: flex-end;

  margin-bottom: 7px;

  font-size: 11px;

  color: #8b8f99;
}

.preview {
  width: min(300px, 70vw);

  max-height: 220px;

  object-fit: contain;

  display: block;

  margin-top: 10px;

  border-radius: 12px;

  border: 1px solid #292c35;
}


/* =========================
   DISCLAIMER
========================= */

.disclaimer {
  text-align: center;

  color: #555963;

  font-size: 9px;

  margin-top: 7px;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

  .header {
    height: 58px;
    min-height: 58px;

    padding: 0 14px;
  }

  .logo {
    width: 31px;
    height: 31px;

    border-radius: 10px;

    font-size: 15px;
  }

  .new-chat {
    padding: 8px 10px;

    font-size: 11px;
  }

  .chat {
    padding:
      24px
      15px
      120px;
  }

  .bubble {
    max-width: 90%;

    font-size: 13px;
  }

  .composer-wrapper {
    padding:
      8px
      12px
      14px;
  }

  .composer {
    border-radius: 15px;
  }

  .upload,
  .send {
    width: 42px;
    min-width: 42px;

    height: 42px;
  }

  textarea {
    font-size: 13px;
  }

  .welcome-logo {
    width: 58px;
    height: 58px;

    border-radius: 18px;

    font-size: 26px;
  }

  .welcome h1 {
    font-size: 30px;
  }

  .welcome p {
    font-size: 13px;
  }
}

/* ========================================
   MARKDOWN
======================================== */

.message-content {
  line-height: 1.6;
  white-space: normal;
}

.message-content strong {
  font-weight: 700;
}

.message-content em {
  font-style: italic;
}

.message-content ul {
  margin: 8px 0;
  padding-left: 22px;
}

.message-content li {
  margin: 4px 0;
}

/* ========================================
   CODE BLOCK
======================================== */

.code-wrapper {
  margin: 14px 0;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  max-width: 100%;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 36px;
  padding: 0 12px;

  background: #181818;
  border-bottom: 1px solid #2a2a2a;

  font-size: 12px;
  color: #999;
}

.copy-code {
  padding: 4px 8px;

  border: 1px solid #333;
  border-radius: 5px;

  background: transparent;
  color: #aaa;

  font-size: 12px;
  cursor: pointer;

  transition: 0.15s ease;
}

.copy-code:hover {
  background: #252525;
  color: #fff;
}

.code-block {
  margin: 0;
  padding: 14px;

  overflow-x: auto;

  background: #111;

  font-size: 13px;
  line-height: 1.6;

  white-space: pre;
}

.code-block code {
  font-family:
    Consolas,
    "Courier New",
    monospace;

  font-size: 13px;
  white-space: pre;

  .code-block::-webkit-scrollbar {
  height: 8px;
}

.code-block::-webkit-scrollbar-track {
  background: #111;
}

.code-block::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 10px;
}

.code-block::-webkit-scrollbar-thumb:hover {
  background: #444;
}
}

@media (max-width: 600px) {
  .code-header {
    height: 34px;
    padding: 0 10px;
    font-size: 11px;
  }

  .copy-code {
    padding: 4px 7px;
    font-size: 11px;
  }

  .code-block {
    padding: 12px;
    font-size: 12px;
  }

  .code-block code {
    font-size: 12px;
  }
}

@keyframes welcomeFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-logo {
  animation: welcomeFade 0.6s ease forwards;
  position: relative;
  box-shadow:
    0 0 40px rgba(255, 255, 255, 0.08),
    0 0 80px rgba(255, 255, 255, 0.03);
}

.welcome-logo::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  opacity: 0.7;
}


.welcome h1 {
  animation: welcomeFade 0.6s ease 0.1s both;
  letter-spacing: 1.5px;
  font-weight: 600;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.08);
}


.welcome p {
  animation: welcomeFade 0.6s ease 0.2s both;
  letter-spacing: 0.3px;
  color: #777;
}

.suggestion.card {
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease; 
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.suggestion-card:hover {
  transform: translateY(-3px);
  background: #1c1c1c;
  border-color: #333;
    transform: translateY(-4px);
}

.suggestion-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 9px;
  background: #222;
  font-size: 17px;
}

.suggestion-card strong {
  display: block;

  margin-bottom: 3px;

  font-size: 13px;
  font-weight: 500;
  color: #eee;
}

.suggestion-card small {
  display: block;

  font-size: 11px;
  color: #888;
}
.suggestion-card:active {
  transform: translateY(-1px) scale(0.98);
}

.suggestion-card {
  opacity: 0;
  animation: suggestionFade 0.5s ease forwards;
}

.suggestion-card:nth-child(1) {
  animation-delay: 0.2s;
}

.suggestion-card:nth-child(2) {
  animation-delay: 0.3s;
}

.suggestion-card:nth-child(3) {
  animation-delay: 0.4s;
}

.suggestion-card:nth-child(4) {
  animation-delay: 0.5s;
}

@keyframes suggestionFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== PREMIUM HOMEPAGE ===== */

.app {
  position: relative;
  overflow: hidden;
}

.app::before {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.025) 30%,
    transparent 70%
  );
  pointer-events: none;
}

.app::after {
  content: "";
  position: absolute;
  width: 350px;
  height: 350px;
  bottom: -150px;
  right: -100px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.035),
    transparent 70%
  );
  pointer-events: none;
}

.welcome {
  position: relative;
  z-index: 1;
}

.suggestion-card {
  position: relative;
  overflow: hidden;

  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);

  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);

  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.suggestion-card:hover {
  transform: translateY(-4px);

  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.13);

  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.28),
    0 0 25px rgba(255, 255, 255, 0.025);
}

.suggestion-card:active {
  transform: translateY(-1px) scale(0.98);
}

.suggestion-icon {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 4px 15px rgba(0, 0, 0, 0.15);

  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.suggestion-card:hover .suggestion-icon {
  transform: scale(1.06);
  background: rgba(255, 255, 255, 0.07);
}

.chat {
  position: relative;
  isolation: isolate;
}

.chat::before {
  content: "";
  position: fixed;
  width: 600px;
  height: 600px;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.035) 0%,
    rgba(255, 255, 255, 0.015) 35%,
    transparent 70%
  );

  pointer-events: none;
  z-index: -1;
}

.message {
  animation: messageAppear 0.25s ease both;
}

@keyframes messageAppear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.tools-panel {
  position: absolute;
  bottom: 70px;
  left: 0;

  width: 260px;
  padding: 8px;

  display: none;
  flex-direction: column;
  gap: 4px;

  background: rgba(20, 20, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;

  backdrop-filter: blur(18px);

  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(255, 255, 255, 0.02);

  z-index: 20;
}

.tools-panel.active {
  display: flex;
  animation: toolsAppear 0.18s ease both;
}

.tool-option {
  width: 100%;
  padding: 9px;

  display: flex;
  align-items: center;
  gap: 10px;

  border: 0;
  border-radius: 8px;

  background: transparent;
  color: #ddd;

  text-align: left;
  cursor: pointer;

  transition: 0.15s ease;
}

.tool-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tool-option > span {
  width: 32px;
  height: 32px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);

  font-size: 15px;
  flex-shrink: 0;
}

.tool-option strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #eee;
}

.tool-option small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: #777;
}

@keyframes toolsAppear {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.selected-file {
  display: none;
  align-items: center;
  gap: 10px;

  width: fit-content;
  max-width: 320px;

  margin-bottom: 8px;
  padding: 8px 10px;

  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;

  color: #ddd;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 6px 20px rgba(0, 0, 0, 0.15);
}

.selected-file.active {
  display: flex;
}

.file-icon {
  width: 32px;
  height: 32px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);

  font-size: 15px;
  flex-shrink: 0;
}

.file-info {
  min-width: 0;
}

.file-name {
  display: block;

  max-width: 220px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 12px;
  color: #ddd;
}

.file-size {
  display: block;
  margin-top: 2px;

  font-size: 10px;
  color: #777;
}

.remove-file {
  width: 24px;
  height: 24px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 6px;

  background: transparent;
  color: #777;

  cursor: pointer;
  transition: 0.15s ease;
}

.remove-file:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.voice-button.recording {
  background: rgba(255, 70, 70, 0.12);
  border-color: rgba(255, 90, 90, 0.35);
  color: #fff;

  animation: voicePulse 1.2s ease-in-out infinite;
}

.voice-status {
  display: none;
  align-items: center;
  gap: 6px;

  margin-left: 4px;

  font-size: 11px;
  color: #999;
}

.voice-status.active {
  display: flex;
}

.voice-dot {
  width: 6px;
  height: 6px;

  border-radius: 50%;
  background: #ff6666;

  box-shadow: 0 0 10px rgba(255, 80, 80, 0.6);

  animation: dotPulse 0.9s ease-in-out infinite;
}

@keyframes voicePulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 70, 70, 0);
  }

  50% {
    box-shadow: 0 0 18px rgba(255, 70, 70, 0.18);
  }
}

@keyframes dotPulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}