:root {
  --text-primary: #2c3e50;
  --text-secondary: #4a5568;
  --text-light: #718096;
}

body {
  margin: 0;
  padding: 0;
  color: var(--text-primary);
}

#app {
  width: 100%;
  min-height: 100vh;
}

#content {
  width: 100% !important
}

/* Login styles */
.login-container {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  padding: 1rem;
  overflow-x: hidden;
}

.login-box {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

/* Sidebar styles */
#sidebar {
  min-height: 100vh;
  width: 250px;
  transition: all 0.3s ease;
}

#sidebar.collapsed {
  width: 80px;
}

.sidebar-link {
  color: #333;
  text-decoration: none;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  transition: all 0.5s;
}

.sidebar-link:hover {
  background-color: lightgray;
}

.sidebar-link.active {
  background-color: #BDBDBD;
  font-weight: 500;
}

.sidebar-link i {
  margin-right: 10px;
  font-size: 1.2rem;
}

#sidebar.collapsed .link-text {
  display: none;
}

#sidebar:not(.collapsed) .link-text {
  display: inline-block;
  transition: all 0.3s ease;
  white-space: nowrap;
}

/* Tickets page styles */
.tickets-container {
  display: flex;
  flex-direction: column;
}

.filters-container {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  padding: 15px;
  background: white;
  border-radius: 8px;
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
  border: solid .1px lightgrey;
}

.routes-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /*3 if Thái Nguyên - Hà Đông*/
  gap: 20px;
  /* margin: 10px; */
  width: 100%;
  overflow-y: auto;
  padding: 5px;
}

.route-column {
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  border: solid .1px lightgrey;
  height: fit-content;
}

.schedule-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr); /*5 if Thái Nguyên - Hà Đông*/
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 8px;
}

/* Add or update these styles for better UI/UX */

/* Schedule item styles */
.schedule-item {
  cursor: pointer;
  border: 1px solid #ddd;
  transition: all 0.2s ease;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  z-index: 1;  /* Needed for the overlay positioning */
}

/* Add this new style for the fill bar */
.schedule-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--fill-width, 0%);
  background-color: var(--fill-color, lightgreen); /* Use CSS variable for color */
  z-index: -1;
  transition: width 0.3s ease;
}

.schedule-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(200, 200, 200, 0.35); /* Light grey overlay */
  z-index: -1;
}

/* Past route overlay */
.schedule-item.past-route::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(200, 200, 200, 0.7); /* Light grey overlay */
  z-index: -1;
}

/* Keep existing hover and selected styles */
.schedule-item:hover {
  border-color: #ffc107; /* Yellow border on hover */
  transform: translateY(-2px);
}

.schedule-item.selected {
  border-color: #fd7e14; /* Orange border for selected item */
  box-shadow: 0 0 5px rgba(253, 126, 20, 0.5); /* Add subtle shadow for emphasis */
  border-width: 2px;
}

/* Make sure the text is readable regardless of the background fill */
.schedule-item > div {
  position: relative;
  z-index: 2;
}

.hour-picker .form-select {
  cursor: pointer;
  border-color: #ced4da;
}

.hour-picker .form-select:focus {
  border-color: #fd7e14;
  box-shadow: 0 0 0 0.25rem rgba(253, 126, 20, 0.25);
}

.hour-picker .input-group-text {
  background-color: #fd7e14;
  color: white;
  border-color: #fd7e14;
}

.schedule-item {
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 6px;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 0.5px solid lightgrey;
  transition: border-color 0.2s ease;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 5px;
}

.schedule-item:hover {
  transform: translateY(-2px);
  border-color: #ffc107; /* Yellow border on hover */
}

.schedule-item.selected {
  border-color: #fd7e14; /* Orange border for selected item */
  box-shadow: 0 0 5px rgba(253, 126, 20, 0.5); /* Add subtle shadow for emphasis */
}

#alertModal {
  z-index: 9100
}

.seat-map-container {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

hr {
  opacity: 1;
}

.seat, .package {
  padding: 5px;
  border-radius: 6px;
  background-color: #FFF9C4;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 100px;
  height: 200px; /* Adjusted height for better visibility */
  /* min-height: 129.094px !important; */
  position: relative;
  overflow: hidden;
}

.disabled {
  background-color: lightgrey;
  cursor: not-allowed;
}

.fs-7 {
  font-size: 0.8rem;
}

.seat::before, .package::before {
  content: attr(data-seat);
  position: absolute;
  top: 90%;
  left: 90%;
  transform: translate(-10%, -50%);
  font-size: 15px;
  opacity: 0.3;
  font-weight: bold;
  pointer-events: none;
  z-index: 0;
}

.seat.driver {
  background-color: lightskyblue; /*e0e0e0 */
}

.seat.occupied {
  background-color: #FDDECF;  /*#ff9999*/
}

.seat.duplicated {
  background-color: #4DD0E1;
}

.seat:hover {
  transform: translateY(-2px);
}

.seat-number {
  font-weight: bold;
  margin-bottom: 5px;
}

.seat-details {
  font-size: 16px;
  color: #333;
  line-height: 1.3;
}

.seat-details div {
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Customers styles */
.customers-container {
  padding: 20px;
  background: white;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.customers-container .toolbar {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
}

#customersTable {
  border: 0.1px solid lightgrey;
}

#customersTable td, #customersTable th {
  vertical-align: middle;
  border: 0.1px solid lightgrey;
}

#customersTable th[data-sort]:hover {
  background-color: #f8f9fa;
}

#customersTable .btn {
  margin-right: 5px;
}

/* Existing styles for datepicker */
.datepicker {
  display: none;
}

.datepicker.datepicker-dropdown.dropdown-menu.show {
  display: block;
}

.input-group-text {
  cursor: pointer;
}

.datepicker-dropdown {
  z-index: 1060 !important;
}

/* .booking-modal .card-body {
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.booking-modal.form-collapsed .card-body {
  max-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

.booking-modal .ui-resizable-handle {
  width: 10px;
  height: 10px;
  background-color: #ccc;
  border-radius: 50%;
  z-index: 90;
}

.booking-modal .ui-resizable-se {
  right: -5px;
  bottom: -5px;
  cursor: se-resize;
} */

#ui-datepicker-div {
  z-index: 9001 !important
}

/* Style for checkboxes (the checkbox itself) */
input[type="checkbox"][id^="seatG"]:not(:disabled) {
  accent-color: #28a745; /* Green for available seats */
}

input[type="checkbox"][id^="seatG"]:disabled {
  accent-color: #6c757d; /* Grey for disabled/occupied seats */
}

/* Style for labels (the text next to the checkbox) */
input[type="checkbox"][id^="seatG"]:not(:disabled) + label {
  color: #28a745; /* Green text for available seats */
}

#ticketHistorySidebar {
  max-height: 700px;
  transition: width 0.3s;
}

.ticket-history-item {
  font-size: 0.875rem;
}

/* For mobile responsiveness */
@media (max-width: 768px) {
  #bookingModal .card-body {
    flex-direction: column;
  }
  
  #ticketHistorySidebar {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
    max-height: 200px;
  }
}

/* Add these styles to highlight the selected ticket's seats */
.ticket-seat-highlight {
  border: 3px solid #fd7e14 !important;
  box-shadow: 0 0 8px rgba(253, 126, 20, 0.6);
  transform: scale(1.02);
  transition: all 0.2s ease-in-out;
  animation: beatEffect 1s infinite;
}

/* Apply the animations */
.ticket-seat-beat {
  animation: seat-beat 1s ease-in-out infinite;
}

@keyframes beatEffect {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Package Modal Styles */
.package-modal {
  z-index: 9000;
}

.package-modal.minimized {
  width: 200px !important;
  height: 45px
}

.package-modal.minimized .card {
  width: 200px !important;
}

.booking-modal {
  z-index: 9000;
}

.booking-modal.minimized {
  width: 200px !important;
  height: 45px
}

.booking-modal.minimized .card {
  width: 200px !important;
}

/* For package items table */
#packageItemsTable td {
  padding: 0.25rem;
  vertical-align: middle;
}

#packageItemsTable .form-control,
#packageItemsTable .form-select {
  padding: 0.25rem 0.5rem;
  height: auto;
}

#addScheduleModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  display: none;
}

#addScheduleModal .modal-dialog {
  margin: 60px auto;
  max-width: 500px;
}

#addScheduleModal .modal-content {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Styling for the package status */
#packageStatus option[value="Đang trên xe"] { color: #ffc107; }
#packageStatus option[value="Hủy"] { color: #dc3545; }


/* .cancel-schedule-btn {
  padding: 2px;
  margin: 2px;
  z-index: 100;
  background: none;
  border: none;
}

.cancel-schedule-btn:hover:not([disabled]) {
  transform: scale(1.2);
}

.cancel-schedule-btn[disabled] {
  cursor: not-allowed;
} */

.edit-schedule-btn {
  padding: 4px 8px;
  margin: 0;
  z-index: 100;
  background: none;
  border: none;
  opacity: 0.7;
}

.edit-schedule-btn:hover {
  transform: scale(1.2);
  opacity: 1;
}

.edit-schedule-btn i {
  font-size: 16px;
}

#editScheduleModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  display: none;
}

#editScheduleModal .modal-dialog {
  margin: 60px auto;
  max-width: 500px;
}

#editScheduleModal .modal-content {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Config page styles */
.config-container .nav-tabs {
  border-bottom: 2px solid #dee2e6;
}

.config-container .nav-tabs .nav-link {
  margin-bottom: -2px;
  border: none;
  color: #495057;
}

.config-container .nav-tabs .nav-link.active {
  color: #0d6efd;
  border-bottom: 2px solid #0d6efd;
}
.context-menu {
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
  z-index: 1000;
}

.context-menu-item {
  padding: 8px 12px;
  cursor: pointer;
}

.context-menu-item:hover {
  background: #f8f9fa;
}

.tabulator-footer button {
  margin: 8px;
}

.selectize-control {
  margin-bottom: 0;
}
.selectize-input {
  border: 1px solid #ced4da;
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
}
.selectize-dropdown {
  z-index: 1050;
}
.selectize-dropdown .option {
  padding: 6px 10px;
}
.selectize-dropdown .active {
  background-color: #0d6efd;
  color: white;
}
.selectize-dropdown .option strong {
  display: block;
}
.selectize-dropdown .option small {
  color: #6c757d;
}

/* Trip list styles */
.trip-list {
  border-radius: 0.25rem;
  overflow: hidden;
}

.trip-item {
  border-left: 3px solid #0d6efd;
  transition: all 0.2s ease;
}

.trip-item:hover {
  background-color: rgba(13, 110, 253, 0.05) !important;
}

.trip-details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.trip-details-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background-color: rgba(0,0,0,0.03);
  border-radius: 4px;
}

.detail-item.total {
  font-weight: bold;
  background-color: rgba(13, 110, 253, 0.1);
}

.detail-label {
  color: #555;
}

.detail-value {
  font-weight: 500;
}

.trip-summary {
  background-color: #f8f9fa;
  border-top: 2px solid #dee2e6;
}

@media (max-width: 768px) {
  .trip-details-grid {
      grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .trip-details-grid {
      grid-template-columns: 1fr;
  }
}

/* Package section styles */
.package-section {
  border-top: 1px dashed #dee2e6;
  padding-top: 0.75rem;
}

.package-header {
  display: flex;
  align-items: center;
  color: #495057;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.package-table-container {
  overflow-x: auto;
  max-height: 200px;
  overflow-y: auto;
}

.package-table {
  font-size: 0.85rem;
  margin-bottom: 0;
}

.package-table td, .package-table th {
  vertical-align: middle;
  padding: 0.3rem 0.5rem;
}

.toggle-packages {
  color: #6c757d;
}

.toggle-packages:hover {
  color: #0d6efd;
}

.lock-by-user, .whole-car {
  background-color: lightcoral; /* Light yellow background */
  color: black; /* Dark yellow text */
  cursor: not-allowed;
  position: relative;
  opacity: 0.7
}

.lock-by-user::after {
  content: "Ai đó đang chọn ghế này";
  font-weight: bold;
  font-size: 0.9rem;
  color: black;
  text-align: center;
  width: 100%; /* Ensure the text has a width constraint */
  max-width: 120px; /* Limit maximum width */
  pointer-events: none;
}

.lock-by-user[data-username]:not([data-username=""])::after {
  content: attr(data-username) " đang chọn ghế này";
}

.whole-car::after {
  content: var(--content-wholecar, "");
  font-weight: bold;
  font-size: 3rem;
  color: #6c757d;
  text-align: center;
  width: 100%; /* Ensure the text has a width constraint */
  max-width: 120px; /* Limit maximum width */
  pointer-events: none;
}

.trip-card {
    border: 1px solid black;
    text-align: center;
    width: 80px;
  }

.trip-card div:first-child {
  border-bottom: 1px solid black;
  padding: 4px;
}

#cancelTicketModal .modal-body label {
  font-weight: 500;
}

div:where(.swal2-container) {
  z-index: 12000 !important;
}

/* ============================================
   V2 Ticket Layout Styles 
   ============================================ */

/* V2 Container */
.tickets-container-v2 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* V2 Filters Bar */
.filters-container-v2 {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Merged Schedule Grid */
.merged-schedule-grid {
  scrollbar-width: thin;
  scrollbar-color: #adb5bd #f8f9fa;
}

.merged-schedule-grid::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.merged-schedule-grid::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 4px;
}

.merged-schedule-grid::-webkit-scrollbar-thumb {
  background: #adb5bd;
  border-radius: 4px;
}

.merged-schedule-grid::-webkit-scrollbar-thumb:hover {
  background: #6c757d;
}

/* V2 Schedule Items */
.schedule-item-v2 {
  transition: all 0.3s ease;
}

.schedule-item-v2:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.schedule-item-v2.selected {
  border-color: #0d6efd !important;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.3) !important;
  background: #e7f1ff !important;
}

.schedule-item-v2 .btn-view-seats {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.schedule-item-v2:hover .btn-view-seats,
.schedule-item-v2.selected .btn-view-seats {
  opacity: 1;
}

.schedule-item-v2 .btn-view-seats:hover {
  background: #0a58ca !important;
  transform: scale(1.05);
}

/* Bridge Badge */
.bridge-badge {
  display: inline-block;
  animation: fadeIn 0.3s ease;
}

/* Seat Map Panels - Full Height without Internal Scrolling */
.seat-maps-layout {
  height: auto !important;
  max-height: none !important;
  overflow-y: visible !important;
}

#selectedSeatMapContent,
#sameHourSeatMapsContent {
  max-height: none !important;
  overflow-y: visible !important;
  height: auto !important;
}

.seat-maps-layout .card {
  height: auto;
}

.seat-maps-layout .card-body {
  padding: 1rem;
  overflow: visible !important;
}

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

/* Seat Maps Layout */
.seat-maps-layout {
  margin-top: 8px;
}

.seat-maps-layout .card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: none;
}

.seat-maps-layout .card-header {
  font-weight: 600;
  padding: 12px 16px;
}

.seat-maps-layout .card-body {
  max-height: 600px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #adb5bd #f8f9fa;
}

.seat-maps-layout .card-body::-webkit-scrollbar {
  width: 6px;
}

.seat-maps-layout .card-body::-webkit-scrollbar-track {
  background: #f8f9fa;
}

.seat-maps-layout .card-body::-webkit-scrollbar-thumb {
  background: #adb5bd;
  border-radius: 3px;
}

/* V2 Compact Seat Map */
.seat-map-container-v2 {
  transition: all 0.3s ease;
}

.seat-map-container-v2:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.seats-grid-v2 {
  animation: slideIn 0.3s ease;
}

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

/* Compact Seat Styles */
.seat-compact {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seat-compact .seat-label {
  background: #0d6efd;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 12px;
  min-width: 32px;
  text-align: center;
}

.seat-compact.seat-empty .seat-label {
  background: #e9ecef;
  color: #6c757d;
}

.seat-compact.seat-whole-car .seat-label {
  background: #ffc107;
  color: #000;
}

.seat-compact .seat-info {
  flex: 1;
  font-size: 11px;
  line-height: 1.3;
}

.seat-item-v2 {
  transition: all 0.2s ease;
}

.seat-item-v2.occupied {
  background: #fff3cd !important;
  border-color: #ffc107 !important;
}

.seat-item-v2.duplicated {
  background: #f8d7da !important;
  border-color: #dc3545 !important;
}

.seat-item-v2.locked {
  background: #ffe5e5 !important;
  opacity: 0.7;
}

.seat-item-v2.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .merged-schedule-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    max-height: 200px !important;
  }
  
  .seat-maps-layout .col-md-6 {
    width: 100%;
  }
  
  .seat-maps-layout .card-body {
    max-height: 400px;
  }
  
  .seats-grid-v2 {
    grid-template-columns: 1fr !important;
  }
}

/* Loading spinner */
.spinner-border-sm {
  width: 1.5rem;
  height: 1.5rem;
  border-width: 0.2em;
}
