/* styles/tracking.css */

/* --- AUTH STATE CARD --- */
.auth-container {
  max-width: 460px;
  margin: 80px auto;
  animation: fadeIn 0.4s ease;
}

.auth-card {
  border-top: 4px solid var(--primary-blue);
  padding: 40px;
  box-shadow: 0 20px 40px rgba(11, 37, 69, 0.08);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-header h2 {
  font-size: 26px;
  color: var(--deep-navy);
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 14px;
  color: var(--text-grey);
}

/* --- TRACKING LAYOUT --- */
.tracking-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 32px;
  margin-bottom: 80px;
  align-items: start;
}

@media (max-width: 992px) {
  .tracking-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Bookings Sidebar List */
.bookings-list-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.booking-item-card {
  background-color: var(--white);
  border: 1px solid var(--border-grey);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-card-normal);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.booking-item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(22, 87, 255, 0.15);
}

.booking-item-card.active {
  border-color: var(--primary-blue);
  box-shadow: var(--shadow-card-hover);
  background-color: var(--sky-blue);
}

.booking-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.booking-item-title {
  font-family: var(--font-headings);
  font-size: 16px;
  font-weight: 600;
  color: var(--deep-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.booking-item-title i {
  color: var(--primary-blue);
  width: 18px;
  height: 18px;
}

.booking-item-details {
  font-size: 13px;
  color: var(--text-grey);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Color Coded Status Badges */
.badge-status {
  padding: 4px 10px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-status.pending {
  background-color: rgba(245, 166, 35, 0.1);
  color: var(--warning-amber);
}

.badge-status.confirmed {
  background-color: var(--sky-blue);
  color: var(--primary-blue);
}

.badge-status.completed {
  background-color: rgba(34, 197, 94, 0.1);
  color: var(--success-green);
}

.badge-status.cancelled {
  background-color: rgba(91, 107, 130, 0.1);
  color: var(--text-grey);
}

/* Detail View Container */
.tracking-detail-pane {
  background-color: var(--white);
  border: 1px solid var(--border-grey);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--shadow-card-normal);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (max-width: 576px) {
  .tracking-detail-pane {
    padding: 20px 16px;
  }
}

/* --- HORIZONTAL STATUS TRACKER --- */
.status-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 20px 0;
}

.status-timeline::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 4px;
  background-color: var(--border-grey);
  z-index: 1;
}

/* Active Line Fill animation */
.timeline-fill-bar {
  position: absolute;
  top: 14px;
  left: 0;
  height: 4px;
  background-color: var(--primary-blue);
  z-index: 2;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0;
}

.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 3;
  flex: 1;
  text-align: center;
}

.timeline-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--white);
  border: 3px solid var(--border-grey);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headings);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-grey);
  transition: all 0.3s ease;
}

.timeline-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-grey);
}

.timeline-node.completed .timeline-circle {
  background-color: var(--primary-blue);
  border-color: var(--primary-blue);
  color: var(--white);
}

.timeline-node.completed .timeline-label {
  color: var(--deep-navy);
}

/* --- EN ROUTE MAP --- */
.route-map-viewport {
  height: 320px;
  background-color: #e2e8f0;
  border: 1px solid var(--border-grey);
  border-radius: var(--radius-card);
  position: relative;
  overflow: hidden;
  background-image: radial-gradient(circle, #cbd5e1 8%, transparent 9%), radial-gradient(circle, #cbd5e1 8%, transparent 9%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

.route-dashed-line {
  position: absolute;
  top: 50%;
  left: 15%;
  width: 70%;
  height: 2px;
  border-top: 3px dashed var(--mid-blue);
  transform: rotate(-8deg);
  opacity: 0.6;
}

.route-vehicle {
  position: absolute;
  background-color: var(--primary-blue);
  color: var(--white);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 42%;
  left: 15%;
  transform: translate(-50%, -50%);
  transition: left 4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(22, 87, 255, 0.25);
  z-index: 5;
}

.route-home-marker {
  position: absolute;
  color: var(--primary-blue);
  fill: var(--sky-blue);
  top: 35%;
  left: 85%;
  transform: translate(-50%, -50%);
  z-index: 4;
}

/* --- CHAT MODAL OVERLAY --- */
.chat-drawer {
  position: fixed;
  bottom: 0;
  right: 40px;
  width: 360px;
  height: 480px;
  background-color: var(--white);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border: 1px solid var(--border-grey);
  border-bottom: none;
  box-shadow: 0 -10px 30px rgba(11, 37, 69, 0.15);
  display: none;
  flex-direction: column;
  z-index: 1050;
  animation: slideUpChat 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpChat {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.chat-header {
  background-color: var(--deep-navy);
  color: var(--white);
  padding: 16px 20px;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-messages-box {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 75%;
  font-size: 13px;
  font-family: var(--font-body);
  line-height: 1.4;
}

.chat-bubble.provider {
  background-color: var(--sky-blue);
  color: var(--deep-navy);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-bubble.user {
  background-color: var(--primary-blue);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-input-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--border-grey);
  display: flex;
  gap: 8px;
}

.chat-input-bar input {
  height: 38px;
  border-radius: 20px;
}

/* Modal backdrop reschedule/cancellation overlay */
.overlay-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(11, 37, 69, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
