/* Page-level layout primitives */

html { scroll-behavior: smooth; }
body { font-family: var(--ta-font); background: #f8f9fa; color: #2c3e50; }

.main-content { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-container { flex: 1; display: flex; flex-direction: column; max-width: 800px; margin: 0 auto; width: 100%; padding: 0 24px; min-height: 0; }

/* Header layout (colors in shared.css) */
.header { padding: 20px 40px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); display: flex; align-items: center; justify-content: space-between; }
.header h1 { margin: 0; font-size: 1.8em; font-weight: 600; }
.header-controls { display: flex; align-items: center; gap: 20px; }

/* Controls area below transcript */
.controls { background: #ffffff; border-top: 1px solid #e1e8ed; padding: 16px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.voice-controls { display: flex; justify-content: center; }

/* Pinned card styles (generalized for any card type) */
.pinned-card-container {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  background: #ffffff;
  border-top: 1px solid #e1e8ed;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 16px 24px;
}

/* Adjust transcript padding when any card is pinned */
.transcript-with-pinned-card {
  padding-bottom: 120px !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header { padding: 16px 20px; }
  .header h1 { font-size: 20px; }
  .chat-container { padding: 0 16px; }
  .transcript { padding: 16px !important; }
  .controls { padding: 12px 16px; }
  .message-bubble { max-width: 85%; }
  .text-input-container { max-width: 100%; }
  
  .pinned-card-container {
    padding: 12px 16px;
  }
  
  .transcript-with-pinned-card {
    padding-bottom: 100px !important;
  }
}

/* Trip summary bar */
.trip-summary-bar {
  display: grid;
  grid-template-columns: repeat(9, minmax(80px, 1fr));
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e1e8ed;
  background: #f9fbff;
  align-items: center;
}
.trip-summary-bar .trip-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trip-summary-bar .label { font-size: 10px; color: #8e9aaf; text-transform: uppercase; letter-spacing: 0.05em; }
.trip-summary-bar .value { font-size: 13px; color: #2c3e50; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Prevent trip summary bar from overlapping the text input when it is fixed at bottom */
body { --trip-bar-height: 52px; }
/* Only reserve space when the bar is visible */
.has-trip-bar .controls { padding-bottom: calc(16px + var(--trip-bar-height)); }
.has-trip-bar .transcript { padding-bottom: calc(16px + var(--trip-bar-height)); }


