/* ==========================================================================
   ROUTE PLANNER & CONNECTED TIMELINE STYLESHEET
   Kavya Cabs — Tour Studio
   ========================================================================== */

:root {
  --rp-primary: #FFCC00;
  --rp-primary-hover: #E5A900;
  --rp-primary-glow: rgba(255, 204, 0, 0.28);
  --rp-success: #22C55E;
  --rp-danger: #EF4444;
  --rp-info: #38BDF8;
  --rp-bg-card: rgba(15, 23, 42, 0.75);
  --rp-border: rgba(255, 255, 255, 0.09);
}

/* Stops Container — Seamless full width without double nested padding */
.rp-stops-container {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.rp-stops-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.rp-stops-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rp-header-icon {
  color: var(--rp-primary);
  font-size: 1.05rem;
}

.rp-header-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.rp-header-hint {
  font-size: 0.76rem;
  color: #94A3B8;
  font-weight: 500;
}

.rp-roundtrip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  font-size: 0.80rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: 7px;
  transition: all 0.2s ease;
  margin-left: auto;
}

.rp-roundtrip-toggle:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.rp-roundtrip-toggle input[type="checkbox"] {
  accent-color: var(--rp-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Timeline Route Flow */
.rp-route-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.rp-timeline-step {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  width: 100%;
}

.rp-timeline-step:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.rp-timeline-step.is-start {
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.12) 0%, rgba(15, 23, 42, 0.88) 100%) !important;
  border: 1.5px solid rgba(255, 204, 0, 0.4) !important;
  box-shadow: 0 4px 16px rgba(255, 204, 0, 0.08);
}

.rp-timeline-step.is-start:hover {
  border-color: rgba(255, 204, 0, 0.65) !important;
}

.rp-timeline-step.is-intermediate {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(15, 23, 42, 0.88) 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
}

.rp-timeline-step.is-intermediate:hover {
  border-color: rgba(56, 189, 248, 0.45) !important;
}

.rp-timeline-step.is-return {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(15, 23, 42, 0.88) 100%) !important;
  border: 1.5px solid rgba(34, 197, 94, 0.4) !important;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.08);
}

.rp-timeline-step.is-return:hover {
  border-color: rgba(34, 197, 94, 0.65) !important;
}

.rp-step-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.rp-step-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.rp-step-icon.is-start {
  background: rgba(255, 204, 0, 0.18);
  border: 1.5px solid #FFCC00;
  color: #FFCC00;
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.3);
}

.rp-step-icon.is-stop {
  background: rgba(56, 189, 248, 0.18);
  border: 1.5px solid #38BDF8;
  color: #38BDF8;
  font-size: 13.5px;
}

.rp-step-icon.is-return {
  background: rgba(34, 197, 94, 0.18);
  border: 1.5px solid #22C55E;
  color: #22C55E;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

.rp-step-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.rp-step-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rp-step-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
}

.rp-step-title.is-return {
  color: #22C55E;
}

.rp-step-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.rp-step-badge.is-start {
  background: rgba(255, 204, 0, 0.2);
  color: #FFCC00;
  border: 1px solid rgba(255, 204, 0, 0.4);
}

.rp-step-badge.is-stop {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.rp-step-badge.is-return {
  background: rgba(34, 197, 94, 0.2);
  color: #22C55E;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.rp-step-sub {
  font-size: 0.78rem;
  color: #94A3B8;
  line-height: 1.35;
  word-break: break-word;
}

/* Vertical Timeline Connectors (Centered Between Cards) */
.rp-timeline-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 20px;
  width: 100%;
  position: relative;
  margin: 0;
}

.rp-connector-line {
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, rgba(255, 204, 0, 0.7), rgba(255, 204, 0, 0.2));
  border-radius: 1px;
}

.rp-connector-dot {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFCC00;
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.9);
}

/* Action Buttons — Properly Positioned, Fixed Footprint */
.rp-hub-change-wrap {
  position: relative;
  flex-shrink: 0;
}

.btn-change-start,
#rp-btn-change-hub {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-size: 0.80rem !important;
  font-weight: 700 !important;
  color: #FFCC00 !important;
  background: rgba(255, 204, 0, 0.12) !important;
  border: 1px solid rgba(255, 204, 0, 0.35) !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  letter-spacing: 0.2px !important;
  outline: none !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
  flex-shrink: 0 !important;
}

.btn-change-start:hover,
#rp-btn-change-hub:hover {
  background: rgba(255, 204, 0, 0.25) !important;
  border-color: #FFCC00 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.35) !important;
  transform: translateY(-1px) !important;
}

.btn-change-return,
#rp-btn-change-return {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-size: 0.80rem !important;
  font-weight: 700 !important;
  color: #22C55E !important;
  background: rgba(34, 197, 94, 0.12) !important;
  border: 1px solid rgba(34, 197, 94, 0.35) !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  letter-spacing: 0.2px !important;
  outline: none !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
  flex-shrink: 0 !important;
}

.btn-change-return:hover,
#rp-btn-change-return:hover {
  background: rgba(34, 197, 94, 0.25) !important;
  border-color: #22C55E !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.35) !important;
  transform: translateY(-1px) !important;
}

.rp-step-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-reorder-stop {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  font-size: 10px !important;
  color: #cbd5e1 !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  outline: none !important;
}

.btn-reorder-stop:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

.btn-remove-stop {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  color: #EF4444 !important;
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  padding: 6px 12px !important;
  border-radius: 7px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  outline: none !important;
}

.btn-remove-stop:hover {
  background: rgba(239, 68, 68, 0.24) !important;
  border-color: #EF4444 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35) !important;
  transform: translateY(-1px) !important;
}

/* Add Destination Stop Button — Clean Full Width Card */
.rp-add-stop-timeline-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 2px 0;
  box-sizing: border-box;
}

.rp-btn-add-stop-timeline {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  background: rgba(255, 204, 0, 0.08) !important;
  border: 1.5px dashed rgba(255, 204, 0, 0.6) !important;
  color: #FFCC00 !important;
  padding: 10px 18px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  outline: none !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
  box-sizing: border-box !important;
}

.rp-btn-add-stop-timeline:hover {
  background: rgba(255, 204, 0, 0.2) !important;
  border-color: #FFCC00 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(255, 204, 0, 0.35) !important;
  transform: translateY(-1px) !important;
}

/* Tour Duration Box */
.rp-metrics-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 14px;
  width: 100%;
}

.rp-metric-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.08) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(255, 204, 0, 0.35);
  border-radius: 9px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

.rp-metric-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.rp-metric-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rp-metric-label {
  font-size: 0.84rem;
  color: #cbd5e1;
  font-weight: 700;
}

.rp-days-input {
  width: 52px;
  height: 30px;
  background: #0f172a;
  border: 1.5px solid #FFCC00;
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  text-align: center;
  border-radius: 6px;
  outline: none;
}

.rp-days-badge {
  font-size: 0.88rem;
  font-weight: 800;
  color: #FFCC00;
  background: rgba(255, 204, 0, 0.15);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255, 204, 0, 0.3);
}

.rp-days-text {
  font-size: 0.80rem;
  font-weight: 600;
  color: #94A3B8;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .rp-stops-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .rp-roundtrip-toggle {
    margin-left: 0;
  }
  .rp-timeline-step {
    padding: 10px 12px !important;
    gap: 10px !important;
  }
  .rp-step-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 14px !important;
  }
  .btn-change-start,
  #rp-btn-change-hub,
  .btn-change-return,
  #rp-btn-change-return {
    padding: 6px 10px !important;
    font-size: 0.74rem !important;
  }
}
