/* Bitch Partner - Notion-like UI */

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

:root {
  --font-sans: "Inter", sans-serif;
  --text-color: rgb(25, 25, 24);
  --bg-color: #fafafa;
  --border-color: rgba(55, 53, 47, 0.12);
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
}

body {
  font-family: var(--font-sans);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-32) var(--space-24);
}

/* ========== APP HEADER ========== */
.app-header {
  text-align: center;
  margin-bottom: var(--space-24);
  padding: var(--space-16) var(--space-24);
  margin: calc(-1 * var(--space-32)) calc(-1 * var(--space-24)) var(--space-24);
}

.app-header__title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-color);
  margin: 0;
  padding-bottom: var(--space-16);
}

.app-header__title::after {
  content: "";
  display: block;
  width: 40%;
  height: 1px;
  background: var(--border-color);
  margin: var(--space-16) auto 0;
}

.controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.control {
  flex: 1;
}

.control-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(25, 25, 24, 0.6);
  margin-bottom: 8px;
}

.hint {
  font-size: 13px;
  color: rgba(25, 25, 24, 0.55);
  margin-top: 8px;
}

.segmented {
  display: inline-flex;
  background: rgba(55, 53, 47, 0.06);
  border: 0.5px solid rgba(55, 53, 47, 0.16);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.segmented-btn {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(25, 25, 24, 0.75);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-family: "Inter", sans-serif;
}

.segmented-btn:hover {
  background: rgba(55, 53, 47, 0.08);
  color: rgb(25, 25, 24);
}

.segmented-btn.active {
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  color: rgb(25, 25, 24);
}

.toggle {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 0.5px solid rgba(55, 53, 47, 0.16);
  border-radius: 10px;
}

.toggle input {
  width: 16px;
  height: 16px;
  accent-color: #2383e2;
}

.toggle-text {
  font-size: 14px;
  font-weight: 500;
  color: rgba(25, 25, 24, 0.8);
}

.chat-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.messages {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 52vh;
  overflow-y: auto;
}

.message {
  display: flex;
}

.message.user {
  justify-content: flex-end;
}

.bubble {
  max-width: 78%;
  padding: 8px 14px;
  border-radius: 20px;
  line-height: 1.45;
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(15, 20, 25, 0.04);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 20, 25, 0.06);
}

.message.user .bubble {
  background: #0a84ff;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.15);
}

.message.user .bubble:hover {
  box-shadow: 0 12px 32px rgba(10, 132, 255, 0.2);
}

.message.assistant .bubble {
  background: rgba(55, 53, 47, 0.06);
  border: 0.5px solid rgba(55, 53, 47, 0.12);
  color: var(--text-color);
}

/* Markdown styling within bubbles */
.bubble p {
  margin: 0 0 8px;
}

.bubble p:last-child {
  margin: 0;
}

.bubble ul,
.bubble ol {
  margin: 8px 0;
  padding-left: 20px;
}

.bubble li {
  margin: 4px 0;
}

.bubble code {
  background: rgba(55, 53, 47, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: ui-monospace, "SF Mono", Monaco, "Cascadia Code", "Roboto Mono",
    Consolas, "Courier New", monospace;
}

.message.user .bubble code {
  background: rgba(255, 255, 255, 0.2);
}

.bubble pre {
  background: rgba(55, 53, 47, 0.06);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

.message.user .bubble pre {
  background: rgba(255, 255, 255, 0.15);
}

.bubble pre code {
  background: none;
  padding: 0;
}

.bubble strong {
  font-weight: 600;
}

.bubble h1,
.bubble h2,
.bubble h3 {
  margin: 12px 0 8px;
  font-weight: 600;
}

.bubble h1 {
  font-size: 18px;
}

.bubble h2 {
  font-size: 16px;
}

.bubble h3 {
  font-size: 15px;
}

.bubble a {
  color: #0a84ff;
  text-decoration: underline;
}

.message.user .bubble a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
}

/* Typing animation */
.typing-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aa3ad;
  margin-right: 6px;
  animation: blink 1s infinite;
}

.message.user .bubble .typing-dot {
  background: rgba(255, 255, 255, 0.7);
}

@keyframes blink {
  0% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

.composer {
  border-top: 0.5px solid rgba(55, 53, 47, 0.16);
  padding: 16px;
}

textarea {
  width: 100%;
  min-height: 64px;
  padding: 12px;
  border-radius: 10px;
  border: 0.5px solid rgba(55, 53, 47, 0.16);
  background: rgba(55, 53, 47, 0.04);
  font-size: 16px;
  line-height: 1.55;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease, background 0.2s ease;
  font-family: "Inter", sans-serif;
}

textarea:focus {
  background: white;
  border-color: #2383e2;
}

textarea::placeholder {
  color: rgba(25, 25, 24, 0.4);
}

.composer-row {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 50px;
  background: #000000;
  color: white;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: "Inter", sans-serif;
  white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
  background: #1a1a1a;
}

.btn-primary:active:not(:disabled) {
  background: #333333;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.error {
  margin-top: 10px;
  font-size: 14px;
  color: #991b1b;
  background: rgba(211, 47, 47, 0.08);
  border: 0.5px solid rgba(55, 53, 47, 0.16);
  border-radius: 10px;
  padding: 10px 12px;
}

.examples {
  margin-top: 22px;
  text-align: center;
}

.examples-title {
  font-size: 14px;
  font-weight: 500;
  color: rgba(25, 25, 24, 0.55);
  margin-bottom: 14px;
}

.examples-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.example-btn {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 400;
  color: rgba(25, 25, 24, 0.7);
  background: white;
  border: 0.5px solid rgba(55, 53, 47, 0.16);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
}

.example-btn:hover {
  background: rgba(35, 131, 226, 0.08);
  border-color: rgba(35, 131, 226, 0.3);
  color: #2383e2;
}

@media (max-width: 768px) {
  .container {
    padding: var(--space-24) var(--space-16);
  }

  .app-header {
    padding: var(--space-12) var(--space-16);
    margin: calc(-1 * var(--space-24)) calc(-1 * var(--space-16)) var(--space-20);
  }

  .app-header__title {
    font-size: 28px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .toggle {
    justify-content: center;
  }
}