/*
 * /public/travel_bubble.css
 *
 * Zypps Travel Bubble™ - Stylesheet
 * ---------------------------------
 * Contains isolated styles for the Group Mobility Dashboard.
 * Includes: Timeline, Ride Cards, Chat Interface, and Amadeus Result Grids.
 */

/* --- Global Bubble Container --- */
.bubble-home-view, .bubble-dashboard {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main, #111827);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
  margin-bottom: 2rem;
}

/* --- Header / Hero Section --- */
.bubble-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.bubble-hero {
  background: linear-gradient(to right, #f9fafb, #f3f4f6);
  padding: 2rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.bubble-hero h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  color: var(--primary, #2563eb);
}

.bubble-stats {
  display: flex;
  gap: 0.5rem;
}

.tag {
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* --- Tab Navigation --- */
.bubble-tabs {
  display: flex;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
}

.tab-btn {
  padding: 1rem 1.5rem;
  border: none;
  background: transparent;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #111827;
  background: rgba(0,0,0,0.02);
}

.tab-btn.active {
  color: var(--primary, #2563eb);
  border-bottom-color: var(--primary, #2563eb);
}

/* --- Content Area --- */
.bubble-content {
  padding: 1.5rem;
  min-height: 300px;
}

.bubble-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.bubble-section-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

/* --- Timeline (Itinerary) --- */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 80px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: #e5e7eb;
}

.timeline-item {
  display: flex;
  gap: 2rem;
  position: relative;
}

.time-col {
  width: 80px;
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.info-col {
  flex-grow: 1;
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 0.75rem;
  border-radius: 6px;
  position: relative;
}

.info-col::before {
  content: '●';
  position: absolute;
  left: -2.4rem;
  top: 0.75rem;
  color: var(--primary, #2563eb);
  background: #fff;
  z-index: 1;
}

/* --- Ride Cards --- */
.ride-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.bubble-ride-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
  transition: transform 0.1s;
}

.bubble-ride-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.ride-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.ride-route {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed #e5e7eb;
}

.ride-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #6b7280;
}

.badge {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
}
.badge.success { background: #d1fae5; color: #065f46; }
.badge.warning { background: #fef3c7; color: #92400e; }

/* --- Member List --- */
.member-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.member-avatar {
  width: 36px;
  height: 36px;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.member-info {
  display: flex;
  flex-direction: column;
}

/* --- Explore / Search --- */
.explore-controls {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  gap: 0.5rem;
  align-items: flex-end; /* Align button with inputs */
}

.radius-label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
}

.explore-controls input, .explore-controls select {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.explore-card {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

/* --- Chat --- */
.bubble-chat-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
}

.bubble-chat-history {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 400px; /* Fixed height for inner scroll */
}

.bubble-msg-row {
  display: flex;
  width: 100%;
}

.bubble-msg-row.me { justify-content: flex-end; }
.bubble-msg-row.them { justify-content: flex-start; }

.bubble-msg-content {
  max-width: 70%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  position: relative;
}

.bubble-msg-row.me .bubble-msg-content {
  background: var(--primary, #2563eb);
  color: white;
  border-bottom-right-radius: 0;
}

.bubble-msg-row.them .bubble-msg-content {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 0;
}

.bubble-msg-sender {
  font-size: 0.7rem;
  font-weight: bold;
  margin-bottom: 2px;
  color: #6b7280;
}

.bubble-msg-time {
  font-size: 0.65rem;
  text-align: right;
  opacity: 0.7;
  margin-top: 4px;
}

.bubble-chat-input-area {
  padding: 0.75rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 0.5rem;
}

.bubble-chat-input-area input {
  flex-grow: 1;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

/* --- Modals --- */
.bubble-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.bubble-modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.bubble-modal-content label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 500;
}

.bubble-modal-content input, .bubble-modal-content select {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* --- Utilities --- */
.muted { color: #6b7280; }
.small { font-size: 0.85rem; }
.text-center { text-align: center; }
.row { display: flex; gap: 1rem; width: 100%; }