/*
  Taxi to the Future – Styles
  - Base font size: 14px
  - All sizes use rem units relative to the base
  - Text color: white at 80% opacity (20% transparency)
  - Responsive: two columns on wide screens; stacked with chat first on vertical screens
*/

:root {
  --base-font-size: 14px;
  --text-color: rgba(255, 255, 255, 0.8);
  --panel-bg: rgba(0, 0, 0, 0.3); /* 70% transparent background */
  --bot-bubble: #6b7280; /* gray */
  --user-bubble: #2563eb; /* blue */
  --border-radius: 0.75rem;
  --spacing-1: 0.5rem;
  --spacing-2: 1rem;
  --spacing-3: 1.5rem;
}

html {
  font-size: var(--base-font-size);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text-color);
  background-color: #000;
  background-image: url("../images/background.jpg");
  background-size: cover; /* show full image, cover screen, maintain aspect */
  background-position: center center;
  background-repeat: no-repeat;
  min-height: 100vh;
}

.page {
  display: flex;
  gap: var(--spacing-3);
  padding: var(--spacing-3);
  height: 100vh; /* constrain to viewport height */
  height: 100dvh; /* use dynamic viewport height on modern browsers */
}

/* Left panel holds the title, anchored to bottom-left */
.left-panel {
  display: flex;
  flex-direction: column;
  flex: 0 1 40%;
}

.title-area {
  margin-top: auto; /* push to bottom */
  padding: var(--spacing-2);
}

.title-text {
  margin: 0;
  font-size: 2rem; /* double of base font size */
  line-height: 1.2;
  letter-spacing: 0.02em;
  /* caret */
  position: relative;
}

.title-text::after {
  content: "▍";
  display: inline-block;
  margin-left: 0.25rem;
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  to { opacity: 0; }
}

/* Right panel holds the chat */
.right-panel {
  flex: 1 1 60%;
  display: flex;
  height: 100%; /* fill parent vertical space */
  min-height: 0; /* allow inner scroll areas to work in flexbox */
}

.chat-panel {
  background: var(--panel-bg); /* 70% transparent */
  border-radius: var(--border-radius);
  padding: var(--spacing-2);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
  width: 100%;
  min-height: 0; /* for proper flexbox scrolling */
  flex: 1 1 auto; /* ensure panel fills and allows inner scrolling area */
  height: 100%; /* match parent's fixed height */
}

.messages {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
  overflow-y: auto;
  padding-right: 0.25rem; /* space for scrollbar */
  flex: 1 1 auto; /* grow to fill available space */
  min-height: 0; /* allow flex container to shrink properly */
}

.message {
  max-width: 75%;
  padding: var(--spacing-2);
  border-radius: 1.25rem;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message.bot {
  align-self: flex-start;
  background: var(--bot-bubble);
  color: #fff;
}

.message.user {
  align-self: flex-end;
  background: var(--user-bubble);
  color: #fff;
}

.input-row {
  display: flex;
  gap: var(--spacing-2);
}

#chat-input {
  flex: 1 1 auto;
  padding: var(--spacing-2);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 1rem;
}

#send-button {
  flex: 0 0 auto;
  padding: var(--spacing-2) var(--spacing-3);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(37, 99, 235, 0.9);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

#send-button:hover {
  background: rgba(37, 99, 235, 1);
}

/* Vertical screens: stack, chat first, full width */
@media (orientation: portrait) {
  .page {
    flex-direction: column;
    height: auto; /* allow stacking layout to exceed viewport overall */
    min-height: 100vh;
  }

  .right-panel { order: 1; width: 100%; height: 100vh; height: 100dvh; }
  .left-panel { order: 2; width: 100%; }
}


