/*
  list.css — Bus Booking Page (bus_booking.html)
  Theme: Red #ef3f3e | Navy #1a1a2e
*/

/* =============================================
   1. TEMPLATE ORIGINAL — NAV TABS (date tabs)
   ============================================= */
.list_pg1i .nav-tabs .nav-link {
  border: none;
  padding: 8px 20px;
  color: #333;
  background: #f9f9f9;
  transition: 0.3s;
  border-radius: 6px 6px 0 0;
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 0.3px;
}
.list_pg1i .nav-tabs .nav-link:hover { background: #ef3f3e; color: #fff; }
.list_pg1i .nav-tabs .nav-link.active { background: #ef3f3e; color: #fff; }

.list_pg1i {
  border-radius: 10px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* =============================================
   2. SEARCH BAR
   ============================================= */
#search-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  display: none;
  z-index: 1000;
}
#search-box-container {
  position: relative;
  z-index: 1001;
  justify-content: center !important;
  
}
#list .container-xl {
  display: flex;
  justify-content: center;
}
#list .bg-white {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  border: 1px solid #e8e8e8;
}
.focus-trigger:focus-within,
.form-select:focus,
.dropdown.show .focus-trigger {
  border: 1px solid #ef3f3e !important;
  box-shadow: 0 0 12px rgba(239,63,62,0.2) !important;
}
.swap-icon {
  position: absolute;
  right: -12px;
  top: 55%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 25px; height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1005;
  cursor: pointer;
}
.list_1io .button {
  background: #ef3f3e;
  color: #fff;
  font-weight: bold;
  border-radius: 8px;
  padding: 11px 20px;
  transition: background 0.3s;
  display: block;
  text-align: center;
  text-decoration: none;
}
.list_1io .button:hover { background: #c72f2e; }

/* =============================================
   3. DROPDOWN MENU
   ============================================= */
.dropdown-item:hover { background: #fef0f0; color: #ef3f3e; }
.dropdown-item .fw-bold { font-size: 14px; color: #333; }
.dropdown-item small { font-size: 11px; display: block; }

/* =============================================
   4. BUS CARDS
   ============================================= */
.bus_card {
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #fff;
  transition: box-shadow 0.3s, transform 0.2s;
}
.bus_card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}
.bus_card h3.fw-bold { color: #1a1a2e; }
.bus_card h4.fw-bold { color: #1a1a2e; }

.centered-tabs {
  justify-content: center !important;
  display: flex;
}
.btn-continue {
  background-color: #ef3f3e;
  color: #fff;
  font-weight: bold;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.3s;
}
.btn-continue:hover { background-color: #c72f2e; color: #fff; }
.text-affordable { color: #1e7e34; font-size: 13px; font-weight: 800; line-height: 1.2; }

#list_pg { background: #f4f5f7; }
#list_pg .text-muted.fw-bold.small {
  color: #666;
  font-size: 13px;
  letter-spacing: 0.3px;
}

/* =============================================
   5. STOP SELECTION POPUP
   ============================================= */
.modal-backdrop-custom {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1050;
  align-items: center;
  justify-content: center;
}
.modal-backdrop-custom.open { display: flex; }

.popup-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  animation: popIn 0.2s ease;
}
@keyframes popIn {
  from { transform: scale(0.93); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.popup-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.popup-header h5 { margin: 0; font-weight: 700; font-size: 17px; }
.popup-close-btn {
  background: none; border: none;
  font-size: 24px; cursor: pointer; color: #888; line-height: 1;
}
.popup-body { padding: 20px 24px; }

.stop-card {
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.stop-card:hover    { border-color: #ef3f3e; background: #fef0f0; }
.stop-card.selected { border-color: #ef3f3e; background: #fef0f0; }
.stop-card .stop-time     { font-weight: 700; font-size: 15px; color: #222; }
.stop-card .stop-name     { font-size: 14px; color: #555; }
.stop-card .stop-landmark { font-size: 12px; color: #999; }

.section-label {
  font-size: 12px; font-weight: 700; color: #ef3f3e;
  letter-spacing: 1px; text-transform: uppercase; margin: 0 0 10px;
}

/* =============================================
   6. SEAT MAP POPUP
   ============================================= */
.seat-row {
  display: flex; align-items: center;
  gap: 8px; margin-bottom: 8px;
}
.seat-row-num { font-size: 11px; color: #aaa; width: 20px; text-align: center; flex-shrink: 0; }
.seat-aisle   { width: 20px; flex-shrink: 0; }

.seat {
  width: 38px; height: 38px;
  border-radius: 8px 8px 4px 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  cursor: pointer; border: 1.5px solid transparent;
  flex-shrink: 0; transition: transform 0.1s;
}
.seat:hover:not(.booked) { transform: scale(1.1); }
.seat.available { background: #edf7e0; border-color: #82c341; color: #3a7a00; }
.seat.booked    { background: #f0f0f0; border-color: #ccc;    color: #bbb; cursor: not-allowed; }
.seat.ladies    { background: #fde8f5; border-color: #d87ec0; color: #a0489a; }
.seat.selected  { background: #82c341; border-color: #5a9a1a; color: #fff; }

.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #555; }
.legend-box  { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid; flex-shrink: 0; }

.fare-bar {
  background: #f6fdf0; border: 1px solid #d4edbc;
  border-radius: 10px; padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center; margin-top: 16px;
}
.fare-total { font-size: 22px; font-weight: 800; color: #2a6a00; }
.fare-label { font-size: 12px; color: #888; }

.summary-bar {
  background: #fef0f0; border-left: 3px solid #ef3f3e;
  border-radius: 8px; padding: 10px 14px;
  font-size: 13px; color: #555; margin-bottom: 14px;
}
.btn-popup-confirm {
  background: #ef3f3e; color: #fff; border: none;
  padding: 12px; border-radius: 8px;
  font-weight: 700; font-size: 15px;
  cursor: pointer; width: 100%; margin-top: 16px;
  transition: background 0.15s;
}
.btn-popup-confirm:hover    { background: #c72f2e; }
.btn-popup-confirm:disabled { background: #bbb; cursor: not-allowed; }

/* =============================================
   7. RESPONSIVE — BUS BOOKING PAGE
   ============================================= */
@media screen and (max-width: 767px) {
  .list_1i { margin-top: 8px; margin-bottom: 8px; }
  .list_pg1i .nav-tabs .nav-link { margin-top: 5px; margin-bottom: 5px; }
  .popup-box { border-radius: 10px; max-width: 96vw; }
  .popup-body { padding: 14px 16px; }
  .popup-header { padding: 14px 16px 12px; }
  .seat { width: 32px; height: 32px; font-size: 10px; }
  .seat-aisle { width: 14px; }
  .fare-bar { flex-direction: column; gap: 8px; text-align: center; }
}
@media (min-width: 768px) and (max-width: 991px) {
  .list_1io .button { padding: 10px 15px !important; }
  .popup-box { max-width: 90vw; }
}
@media (min-width: 992px) and (max-width: 1200px) {
  .list_1io .button { padding-left: 20px !important; padding-right: 20px !important; }
}

/* =============================================
   2. SEARCH BOX
   ============================================= */
#search-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  display: none;
  z-index: 1000;
}

#search-box-container {
  position: relative;
  z-index: 1001;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  border: 1px solid #e8e8e8;
  padding: 16px !important;
}

/* All columns equal width and no overflow */
#search-box-container .col-md-2 {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  padding: 0 6px !important;
}

/* Label above each field */
#search-box-container h6 {
  font-size: 11px !important;
  letter-spacing: 0.8px !important;
  margin-bottom: 6px !important;
  color: #888 !important;
  font-weight: 700 !important;
}

/* Input group styling */
#search-box-container .input-group {
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  background: #fff !important;
  cursor: pointer !important;
}
#search-box-container .input-group-text {
  background: #fff !important;
  border: none !important;
  padding: 0 8px !important;
}
#search-box-container .form-control {
  border: none !important;
  box-shadow: none !important;
  background: #fff !important;
  font-size: 14px !important;
  color: #333 !important;
  padding: 1px 30px 8px 30px !important;
  min-width: 0 !important;
  width: 100% !important;
}
#search-box-container .form-control:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Input group focus — red border */
#search-box-container .input-group:focus-within {
  border-color: #ef3f3e !important;
  box-shadow: 0 0 0 3px rgba(239,63,62,0.12) !important;
}

/* Passengers dropdown button */
#search-box-container .form-select {
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  color: #333 !important;
  background: #fff !important;
  box-shadow: none !important;
  padding: 8px 12px !important;
  height: 42px !important;
  cursor: pointer !important;
}
#search-box-container .form-select:focus {
  border-color: #ef3f3e !important;
  box-shadow: 0 0 0 3px rgba(239,63,62,0.12) !important;
}

/* Search button */
#search-box-container .list_1io {
  margin-top: 22px !important;
}
.list_1io .button,
#search-box-container .list_1io a {
  background: #ef3f3e !important;
  color: #fff !important;
  font-weight: bold !important;
  border-radius: 8px !important;
  padding: 10px 20px !important;
  transition: background 0.3s !important;
  display: block !important;
  text-align: center !important;
  text-decoration: none !important;
  border: none !important;
  font-size: 14px !important;
  white-space: nowrap !important;
}
.list_1io .button:hover { background: #c72f2e !important; color: #fff !important; }

/* Swap icon */
.swap-icon {
  position: absolute;
  right: -13px;
  top: 58%;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1005;
  cursor: pointer;
  transition: all 0.2s;
}
.swap-icon:hover { background: #fef0f0; border-color: #ef3f3e; }

/* =============================================
   3. FROM / TO DROPDOWN
   ============================================= */
.list_1i.dropdown { position: relative; }

.list_1i.dropdown .dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: auto !important;
  z-index: 9999 !important;
  min-width: 220px !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
  border: none !important;
  margin-top: 6px !important;
  transform: none !important;
}
.dropdown-item { padding: 10px 16px !important; cursor: pointer !important; }
.dropdown-item:hover { background: #fef0f0 !important; color: #ef3f3e !important; }
.dropdown-item .fw-bold { font-size: 14px !important; color: #333 !important; }
.dropdown-item small { font-size: 11px !important; display: block !important; color: #999 !important; }

/* =============================================
   MOBILE — Search box (max 767px)
   ============================================= */
@media screen and (max-width: 767px) {

  #search-box-container {
    padding: 14px !important;
  }

  /* Stack all fields vertically */
  #search-box-container .row.list_1 {
    flex-direction: column !important;
  }
  #search-box-container .col-md-2 {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding: 1px 30px 1px 30px !important;
    margin-bottom: 1px !important;
  }

  /* Last column — search button */
  #search-box-container .col-md-2:last-child {
    margin-bottom: 0 !important;
  }

  /* Show full date */
  #search-box-container input[type="date"] {
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Search button full width */
  #search-box-container .list_1io { margin-top: 4px !important; }
  .list_1io .button { padding: 12px !important; font-size: 15px !important; }

  /* Dropdown full width */
  .list_1i.dropdown .dropdown-menu {
    width: 100% !important;
    min-width: unset !important;
  }

  /* Hide swap icon */
  .swap-icon { display: none !important; }
}

/* TABLET — Search box (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  #search-box-container .col-md-2 {
    flex: 1 1 45% !important;
    margin-bottom: 10px !important;
  }
  #search-box-container h6 { font-size: 10px !important; }
  .list_1io .button { padding: 10px 12px !important; font-size: 13px !important; }
  .swap-icon { display: none !important; }
}
#search-box-container {
  max-width: 900px !important;
  margin: 0 auto !important;
}


/* ===== DESKTOP ===== */
.bus_card .row.align-items-center {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
}

.bus_card .col-md-3:first-child {
  flex: 0 0 20% !important;
  max-width: 20% !important;
  align-self: center !important; 
}

.bus_card .col-md-2 {
  flex: 0 0 20% !important;
  max-width: 20% !important;
  text-align: center !important;
   align-self: center !important; 
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
}

.bus_card .col-md-3:nth-child(3) {
  flex: 0 0 20% !important;
  max-width: 20% !important;
}

.bus_card .col-md-4 {
  flex: 0 0 40% !important;
  max-width: 40% !important;
  text-align: right !important;
  border-left: 1px solid #e0e0e0 !important;
  padding-left: 20px !important;
}

/* Duration line effect */
.bus_card .col-md-2 {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
}

.bus_card .col-md-2::before,
.bus_card .col-md-2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #ccc;
}

.bus_card .col-md-2 hr {
  display: none !important;
}

.bus_card .col-md-2 span {
  white-space: nowrap;
  font-size: 12px;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {

  
  .bus_card .row.align-items-center {
    flex-wrap: wrap !important;
  }

  /* Time row — teeno ek line mein */
  .bus_card .col-md-3:first-child,
  .bus_card .col-md-2,
  .bus_card .col-md-3:nth-child(3) {
    flex: 1 1 0 !important;
    max-width: none !important;
    min-width: 0 !important;
    width: auto !important;
    padding: 0 4px !important;
  }

  .bus_card .col-md-3:first-child { padding-left: 0 !important; }
  .bus_card .col-md-3:nth-child(3) { padding-right: 0 !important; text-align: right !important; }

  .bus_card .col-md-2 {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px;
    padding: 0 4px !important;
  }

  .bus_card .col-md-2 span { font-size: 15px !important; white-space: nowrap; }
   .bus_card .col-md-2 hr {
    display: inline-block !important;
    width: 20px !important;
    flex: none !important;
    margin: 0 4px !important;
    opacity: 0.3 !important;
    border-top: 1px solid #000 !important;
  }

  .bus_card h4 { font-size: 17px !important; margin-bottom: 1px !important; white-space: nowrap; }
  .bus_card .col-md-3 .text-muted.small { font-size: 15px !important; }

  /* Price row — full width neeche */
 /* Price row — full width neeche */
  .bus_card .col-md-4 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    border-left: none !important;
    border-top: 1px solid #e0e0e0 !important;
    padding: 8px 0 0 0 !important;
    margin-top: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    text-align: left !important;
  }

  .bus_card .col-md-4 > div:first-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .bus_card .col-md-4 h3 {
    font-size: 17px !important;
    margin-bottom: 0 !important;
  }

  .bus_card .col-md-4 .text-affordable {
    font-size: 10px !important;
    margin: 3px 0 0 !important;
    text-align: left !important;
    display: block !important;
  }

  .bus_card .col-md-4 > div:last-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
  }

  .bus_card .btn-continue {
    white-space: nowrap !important;
    padding: 7px 16px !important;
    font-size: 12px !important;
  }
}



/* Bus Direct button */
.btn-bus-direct {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.btn-bus-direct:hover {
  border-color: #ef3f3e;
  color: #ef3f3e;
}

/* Route stop list */
.route-stop {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}
.route-stop:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 24px;
  bottom: -8px;
  width: 2px;
  background: #e0e0e0;
}
.route-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}
.route-dot.first { border-color: #ef3f3e; background: #ef3f3e; }
.route-dot.last  { border-color: #82c341; background: #82c341; }
.route-stop-name { font-size: 14px; font-weight: 600; color: #222; }
.route-stop-time { font-size: 13px; color: #ef3f3e; font-weight: 700; margin-left: auto; white-space: nowrap; }
.route-stop-wait { font-size: 11px; color: #999; }



.dropdown-item .fw-bold {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}