/* ============================================
   COMMON STYLES - Shared between chat and chat_simple
   Base styles used by both full and simple versions
   ============================================ */

/* ============================================
   CSS VARIABLES - DARK THEME
   ============================================ */
:root {
  /* Sidebar */
  --sidebar-bg: #202123;
  --sidebar-text: #ececf1;
  --sidebar-hover: #2a2b32;
  --sidebar-active: #343541;

  /* Chat area */
  --chat-bg: #343541;
  --user-msg-bg: #444654;
  --assistant-msg-bg: #444654;
  --text-primary: #ececf1;
  --text-secondary: #c5c5d2;

  /* Input */
  --input-bg: #40414f;
  --input-border: #565869;
  --input-focus: #5e5e78;

  /* Accents */
  --primary-blue: #19c37d;
  --success-color: #19c37d;
  --warning-color: #ffc107;
  --error-red: #f44336;

  /* Layout */
  --sidebar-width: 260px;
  --max-input-height: 150px;
}

/* ============================================
   RESET AND BASE STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--chat-bg);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

/* ============================================
   MESSAGES - User and Assistant
   ============================================ */

.message {
  display: flex;
  gap: 12px;
  padding: 1.5rem 1rem;
  width: 100%;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.message-assistant {
  justify-content: flex-start;
  /* background: var(--user-msg-bg); */ /* Removed - cleaner look without container background */
}

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-blue);
  color: white;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 4px;
}

.message-content {
  max-width: 48rem;
  padding: 0;
  line-height: 1.75;
  word-wrap: break-word;
  font-size: 15px;
}

.message-user .message-content {
  background: var(--primary-blue);
  color: white;
  padding: 10px 14px;
  border-radius: 18px;
}

/* Remove default message-content styles when it contains a card */
.message-user .message-content-card {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.message-assistant .message-content {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05); /* Message bubble background */
  padding: 10px 14px;
  border-radius: 18px;
}

/* Markdown Styling within messages */
.message-content p {
  margin: 0.5rem 0;
}

.message-content p:first-child {
  margin-top: 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content ul,
.message-content ol {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.message-content li {
  margin: 0.25rem 0;
}

.message-content a {
  color: var(--primary-blue);
  text-decoration: underline;
}

.message-content a:hover {
  text-decoration: none;
}

.message-content code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
}

.message-content pre {
  background: #1e1e1e;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.5rem 0;
}

.message-content pre code {
  background: none;
  padding: 0;
}

.message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5rem 0;
  font-size: 0.9em;
}

.message-content table th,
.message-content table td {
  border: 1px solid var(--input-border);
  padding: 8px 12px;
  text-align: left;
}

.message-content table th {
  background: var(--sidebar-hover);
  font-weight: bold;
}

/* ============================================
   MOBILE HEADER
   ============================================ */

.chat-header {
  display: none;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--chat-bg);
  border-bottom: 1px solid var(--input-border);
}

.mobile-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.chat-title {
  font-size: 1.2rem;
  margin: 0;
  color: var(--text-primary);
  flex: 1;
}

.user-badge {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  background: var(--sidebar-hover);
  border-radius: 4px;
  display: none;
}

/* ============================================
   MAIN CHAT AREA
   ============================================ */

.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* ============================================
   MESSAGES CONTAINER
   ============================================ */

.messages-container {
  background-color: rgba(255, 255, 255, 0.1);
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.messages-container::-webkit-scrollbar {
  width: 8px;
}

.messages-container::-webkit-scrollbar-track {
  background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
  background: var(--sidebar-hover);
  border-radius: 4px;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */

.typing-indicator {
  display: none;
  align-items: center;
  gap: 1rem;
  padding: 1rem 24px;
  max-width: 800px;
}

.typing-indicator.visible {
  display: flex;
}

.typing-dots {
  display: flex;
  gap: 0.3rem;
  padding: 8px 0;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* ============================================
   INPUT AREA
   ============================================ */

.input-area {
  padding: 1rem 24px;
  background: var(--chat-bg);
  border-top: 1px solid var(--input-border);
}

.input-wrapper {
  display: flex;
  gap: 0.5rem;
  max-width: 800px;
  margin: 0 auto;
  align-items: flex-end;
}

.message-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  resize: none;
  min-height: 50px;
  max-height: var(--max-input-height);
  overflow-y: auto;
  line-height: 1.5;
}

.message-input:focus {
  outline: none;
  border-color: var(--input-focus);
}

.message-input::placeholder {
  color: var(--text-secondary);
}

.send-btn {
  padding: 12px 20px;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  align-self: stretch;
}

.send-btn:hover:not(:disabled) {
  opacity: 0.9;
}

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

/* ============================================
   SCROLL TO BOTTOM BUTTON
   ============================================ */

.scroll-to-bottom {
  position: absolute;
  bottom: 100px;
  right: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.scroll-to-bottom.visible {
  display: flex;
}

.scroll-to-bottom:hover {
  background: var(--input-focus);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
}

.empty-state h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 1rem;
}

/* ============================================
   JOURNEY CARDS - Shared between versions
   ============================================ */

.journey-cards-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

/* Controls wrapper - contains filters and sort */
.journey-controls-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* Filter chips */
.journey-filter-chips {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--user-msg-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.filter-chips-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  background: var(--input-focus);
  border-color: var(--primary-blue);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: white;
  font-weight: 600;
}

.filter-chip i {
  font-size: 0.9rem;
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  padding: 0.4rem 0.8rem;
  background: var(--input-bg);
  border-radius: 12px;
}

/* Sort controls */
.journey-sort-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--user-msg-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
}

.sort-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.sort-buttons-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-sort {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-sort:hover {
  background: var(--input-focus);
  border-color: var(--primary-blue);
  color: var(--text-primary);
}

.btn-sort.active {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: white;
  font-weight: 600;
}

.btn-sort i {
  font-size: 0.9rem;
}

/* Cards list wrapper for grid layout */
.journey-cards-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.journey-card {
  background: var(--user-msg-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  max-width: 700px;
}

.journey-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-blue), rgba(25, 195, 125, 0.5));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.journey-card:hover {
  border-color: var(--primary-blue);
  box-shadow: 0 10px 25px rgba(25, 195, 125, 0.2), 0 6px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
}

.journey-card:hover::before {
  opacity: 1;
}

.journey-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.journey-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.journey-badges span {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.badge-fastest {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.25), rgba(255, 193, 7, 0.15));
  color: #ffb300;
  border: 1px solid rgba(255, 193, 7, 0.5);
}

.badge-cheapest {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.25), rgba(76, 175, 80, 0.15));
  color: #66bb6a;
  border: 1px solid rgba(76, 175, 80, 0.5);
}

.badge-best {
  background: linear-gradient(135deg, rgba(25, 195, 125, 0.25), rgba(25, 195, 125, 0.15));
  color: var(--primary-blue);
  border: 1px solid rgba(25, 195, 125, 0.5);
}

.journey-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-blue);
}

.price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: right;
}

.price-legs {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.price-total {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-blue);
}

.journey-route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0;
  margin: 0.5rem 0;
}

.journey-route-time {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.journey-route-time:last-child {
  text-align: right;
}

.time-large {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.location {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.journey-route-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  padding: 0 1rem;
}

.transport-icon {
  font-size: 1.5rem;
  z-index: 2;
  background: var(--user-msg-bg);
  padding: 0.25rem;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.route-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
  z-index: 1;
  opacity: 0.3;
}

.route-duration {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-blue);
  background: var(--user-msg-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  z-index: 2;
  border: 1px solid rgba(25, 195, 125, 0.2);
}

.route-type {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--user-msg-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  z-index: 2;
  font-weight: 600;
}

.journey-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.provider-name {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.journey-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-share,
.btn-details,
.btn-save {
  background: transparent;
  border: 1.5px solid var(--primary-blue);
  color: var(--primary-blue);
  padding: 0.625rem 1.25rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-share:hover,
.btn-details:hover,
.btn-save:hover {
  background: var(--primary-blue);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(25, 195, 125, 0.3);
}

/* Save button styling */
.btn-save {
  border-color: var(--accent-yellow, #fbbf24);
  color: var(--accent-yellow, #fbbf24);
}

.btn-save:hover {
  background: var(--accent-yellow, #fbbf24);
  color: #1a1a1a;
}

.btn-save.saved {
  background: var(--accent-yellow, #fbbf24);
  color: #1a1a1a;
  border-color: var(--accent-yellow, #fbbf24);
}

.btn-save.saved:hover {
  opacity: 0.9;
}

.btn-share {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

.btn-share:hover {
  background: var(--text-secondary);
  color: var(--chat-bg);
}

.journey-intro,
.journey-summary {
  margin: 0.5rem 0;
}

/* Multi-leg journeys */
.journey-route-summary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0;
  margin: 0.5rem 0;
}

.route-summary-time {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.route-summary-time:last-child {
  text-align: right;
}

.route-summary-time .time-large {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.route-summary-time .location {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.route-summary-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
}

.transport-icon-chain {
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.route-summary-middle .route-duration {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-blue);
  background: var(--user-msg-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(25, 195, 125, 0.2);
}

.route-summary-middle .route-type {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--user-msg-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  font-weight: 600;
}

.journey-legs {
  display: none; /* Hide detailed leg-by-leg breakdown - show only on Details modal */
}

.journey-leg {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid var(--input-border);
}

.leg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--input-border);
  gap: 0.5rem;
}

.leg-icon {
  font-size: 1.2rem;
}

.leg-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.leg-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-blue);
  white-space: nowrap;
}

.leg-route {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leg-stop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  gap: 1rem;
}

.leg-time {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 70px;
}

.leg-city {
  color: var(--text-secondary);
  flex: 1;
}

.leg-line {
  width: 2px;
  height: 24px;
  background: var(--input-border);
  margin: 0.25rem 0 0.25rem 35px;
  position: relative;
}

.leg-duration {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.journey-transfer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 8px;
  margin: 0.5rem 0;
}

.transfer-icon {
  font-size: 1.5rem;
  color: var(--warning-color);
}

.transfer-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.transfer-location {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.transfer-wait {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.transfer-notes {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}

.journey-card.multi-leg {
  border-left: 3px solid var(--warning-color);
}

.journey-card.multi-leg:hover {
  border-left-color: var(--primary-blue);
}

/* ============================================
   MODALS
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  background: var(--chat-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--input-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
  line-height: 1;
}

.modal-close:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--sidebar-hover);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--input-border);
}

/* ============================================
   TOASTS - Loading, Error, Success
   ============================================ */

.error-toast {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: var(--error-red);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 9999;
  max-width: 400px;
  word-wrap: break-word;
}

.error-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.success-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--success-color);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 500;
}

.success-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.patience-toast {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
  z-index: 9998;
  max-width: 350px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.patience-toast.visible {
  opacity: 1;
  transform: translateX(0);
}

.patience-toast::before {
  content: "⏳";
  font-size: 1.5rem;
  animation: patienceRotate 2s linear infinite;
}

@keyframes patienceRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 10000;
  gap: 1rem;
}

.loading-overlay.visible {
  display: flex;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary-blue);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay p {
  color: var(--text-primary);
  font-size: 1rem;
}

/* ============================================
   MOBILE RESPONSIVE - Journey Cards
   ============================================ */

@media (max-width: 768px) {
  .journey-card {
    padding: 0.75rem;
  }

  .journey-route {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .journey-route-middle {
    flex-direction: row;
    padding: 0.5rem 0;
  }

  .route-line {
    display: none;
  }

  .journey-actions {
    flex-wrap: wrap;
  }

  .btn-share,
  .btn-details,
  .btn-save {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Responsive controls on mobile */
  .journey-filter-chips,
  .journey-sort-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .filter-chips-group,
  .sort-buttons-group {
    width: 100%;
  }

  .filter-chip,
  .btn-sort {
    flex: 1 1 auto;
    justify-content: center;
    min-width: calc(50% - 0.25rem);
  }

  .results-count {
    align-self: flex-end;
  }

  .message {
    padding: 1rem 0.75rem;
  }

  .input-area {
    padding: 0.75rem;
  }

  .send-btn {
    padding: 12px 16px;
    min-height: 44px;
  }

  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
  }

  .error-toast,
  .patience-toast {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }

  .scroll-to-bottom {
    bottom: 80px;
    right: 1rem;
  }
}

/* ============================================
   DESKTOP RESPONSIVE - Grid Layout
   ============================================ */

/* Tablet and desktop: Single column layout aligned left */
@media (min-width: 768px) {
  .journey-cards-list {
    grid-template-columns: 1fr;
  }

  /* Ensure cards don't stretch */
  .journey-card {
    height: fit-content;
    align-self: start;
  }
}
