@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  color-scheme: dark;
  --bg: #04010b;
  --panel: rgba(11, 12, 34, 0.85);
  --panel-border: rgba(255, 255, 255, 0.1);
  --accent: #8b5cf6;
  --accent-strong: #00f5ff;
  --text: #f5f5ff;
  --muted: rgba(245, 245, 255, 0.6);
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: radial-gradient(circle at top, rgba(139, 92, 246, 0.35), transparent 45%),
    radial-gradient(circle at 70% 30%, rgba(0, 245, 255, 0.2), transparent 40%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.app-shell {
  width: min(1200px, 100%);
  min-height: 80vh;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(9, 9, 24, 0.8), rgba(9, 8, 20, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  overflow: hidden;
  padding: 1.5rem;
}

.panel {
  background: var(--panel);
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-block img {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.logo-block h1 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.9rem;
  margin: 0;
}

.logo-block p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: 0.3s ease;
}

.feature-card h3 {
  margin: 0;
  font-size: 1rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.feature-card:hover {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.08);
}

.login-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 18px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-card__header span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--muted);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.google-btn {
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  padding: 0.9rem 1.1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.google-btn {
  background: #fff;
  color: #0f0c29;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.google-btn img {
  width: 20px;
  height: 20px;
}

.primary-btn {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: var(--bg);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.3);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ghost-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.google-btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.4);
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-prompts button {
  flex: 1 1 140px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s ease;
}

.quick-prompts button:hover {
  border-color: var(--accent-strong);
  color: var(--accent-strong);
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.chat-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-panel__header h2 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
}

.chip {
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(0, 245, 255, 0.15);
  color: var(--accent-strong);
  border: 1px solid rgba(0, 245, 255, 0.35);
}

.chat-panel__messages {
  flex: 1;
  padding-right: 0.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-panel__messages::-webkit-scrollbar {
  width: 6px;
}

.chat-panel__messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.message {
  max-width: 80%;
  padding: 0.95rem 1.2rem;
  border-radius: 20px;
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
  color: var(--text);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(255, 165, 0, 0.9));
}

.message.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.message img {
  width: 100%;
  border-radius: 16px;
  margin-top: 0.5rem;
  display: block;
}

.bot-typing {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-strong);
  animation: blink 1.6s infinite ease-in-out;
}

.bot-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.bot-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-panel__footer {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chat-panel__footer textarea {
  width: 100%;
  border-radius: 20px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  min-height: 110px;
  resize: none;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: center;
}

.file-upload {
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  color: var(--muted);
  transition: border-color 0.2s ease;
}

.file-upload:hover {
  border-color: var(--accent-strong);
}

.image-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.image-row input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--text);
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.toast.visible {
  opacity: 1;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--muted);
}

.status-row strong {
  color: var(--text);
}

.signed-in .google-btn {
  opacity: 0.3;
  pointer-events: none;
}

.signed-in #logout-btn {
  display: inline-flex;
}

#logout-btn {
  display: none;
}

.made-by {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 1.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  body {
    padding: 12px;
  }

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