/* ======================
   Global Overlay & Container
   ====================== */
.ticket-overlay {
  font-family: Gilroy;
  font-size: 19px;
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.ticket-overlay .wrap {
  background: #fff;
  width: 90%;
  max-width: 700px;
  padding: 20px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.ticket-overlay .wrap-bus {
  background: #fff;
  width: 90%;
  max-width: 700px;
  padding: 20px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}


/* Global Close Button */
.ticket-overlay .close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

/* ======================
   Common Styles for Layers
   ====================== */
.ticket-layer {
  /* Only one layer will be visible at a time */
  display: none;
}

.ticket-layer h2 {
  text-align: center;
  font-size: 1.8em;
  margin-bottom: 20px;
}

/* ======================
   Overview Layer (Ticket History)
   ====================== */
#ticketOverviewLayer {
  display: block; /* Default visible layer on overlay open */
}

.ticket-history {
  margin-bottom: 20px;
}

.ticket-history h3 {
  font-size: 1.4em;
  margin-bottom: 10px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}


/* Container to hold the table and enable scrolling */
.ticket-history {
    overflow-y: auto; /* Enables scrolling for tbody */
    position: relative; /* Ensures positioning works correctly */
}

/* Table Styling */
.ticket-history table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Ensures consistent column width */
}

/* Fixed Header */
.ticket-history thead {
    display: table; /* Keeps header part of the table */
    width: 100%;
    position: sticky;
    top: 0; /* Sticks to the top */
    z-index: 10; /* Ensures it stays above scrolling content */
    border: none;         /* Remove border */
    background: none;      /* Remove background */
}

/* Scrollable Table Body */
.ticket-history tbody {
    display: block;
    width: 100%;
    max-height: 350px; /* Adjust as needed */
    overflow-y: auto; /* Enables vertical scrolling */
    width: 100%;
}

/* Table Cells */
.ticket-history th, .ticket-history td {
    padding: 6px;
    text-align: center;
    border: 1px solid #ddd;
}

.ticket-history thead th {
  padding: 12px;
  text-align: center;
  border: none; 
  background-color: #f5f5f5;
  text-indent: -10px;
}

/* Column Widths (Adjustable Based on Your Needs) */
.ticket-history th:nth-child(1), .ticket-history td:nth-child(1) { width: 20%; } /* Name */
.ticket-history th:nth-child(2), .ticket-history td:nth-child(2) { width: 20%; } /* Subject */
.ticket-history th:nth-child(3), .ticket-history td:nth-child(3) { width: 20%; } /* Create Time */
.ticket-history th:nth-child(4), .ticket-history td:nth-child(4) { width: 20%; } /* Status */

/* Header Styling */
.ticket-history th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* Row Hover Effect */
.ticket-history tr.ticket-row {
  cursor: pointer;
}

.ticket-history tr.ticket-row:hover {
    background-color: #f2f2f2;
}

/* Ensuring Scrollbar Doesn't Affect Width */
.ticket-history tbody::-webkit-scrollbar {
    width: 4px;
}

.ticket-history tbody::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

.ticket-history tbody::-webkit-scrollbar-track {
    background: #f0f0f0;
}


#newTicketBtn {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 15px;
  background-color: #348641;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#newTicketBtn:hover {
  background-color: #2e753a;
}

/* ======================
   Chat Layer (Existing Ticket Details)
   ====================== */
#ticketChatLayer .back-btn {
  background: none;
  border: none;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 10px;
  color: #348641;
}

.ticket-chat-history {
  max-height: 230px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #ddd;
  background: #f9f9f9;
}

.chat-message {
  padding: 5px 8px;       /* Reduced padding */
  margin: 4px 0;          /* Smaller vertical margin */
  max-width: 80%;
  clear: both;
  border-radius: 5px;
  line-height: 1.2;       /* Reduced line height */
}


/* Admin messages: left aligned */
.left-message {
  background-color: #e9ecef;
  float: left;
  text-align: left;
}

/* Client messages: right aligned */
.right-message {
  background-color: #e9ecef;
  float: right;
  text-align: right;
}

.chat-header {
  font-weight: bold;
  margin-bottom: 5px;
}

.chat-time {
  margin-left: 10px;
  font-size: 0.9em;
  color: #666;
}

.ticket-reply textarea {
  font-size: 19px;
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}

.ticket-reply .reply-btn {
  background-color: #348641;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.ticket-reply .reply-btn:hover {
  background-color: #2c7438;
}

/* ======================
   New Ticket Layer (Creation Form)
   ====================== */
#ticketNewLayer .back-btn {
  background: none;
  border: none;
  font-weight: bold;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 10px;
  color: #348641;
}

#ticketNewLayer form {
  display: flex;
  flex-direction: column;
}

#ticketNewLayer label {
  margin-bottom: 5px;
  font-weight: bold;
}

#ticketNewLayer input[type="text"],
#ticketNewLayer textarea {
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}

#ticketNewLayer button[type="submit"] {
  background-color: #348641;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#ticketNewLayer button[type="submit"]:hover {
  background-color: #2e753a;
}


#access-control-list {
  margin-top: 20px;
  padding: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
}

.user-name {
  flex: 1;
  font-weight: bold;
  font-size: 18px;
}

.radio-group-access {
  display: flex;
  gap: 20px;
}

.radio-option {
  position: relative;
  padding-left: 24px;
  cursor: pointer;
  font-size: 19px;
}

.radio-option input[type="radio"] {
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
}

.radio-circle {
  position: absolute;
  left: 0;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #888;
  background-color: #fff;
}

.radio-option input[type="radio"]:checked + .radio-circle {
  background-color: #007bff;
  border-color: #007bff;
}

.access-heading {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  padding: 20px 0 10px 0;
  color: #111;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 20px;
  border-radius: 8px 8px 0 0;
}

.profile-wrap {
  max-width: 480px;
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.profile-heading {
  text-align: center;
  margin-bottom: 16px;
}

.profile-heading h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.profile-heading p {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.profile-info {
  font-size: 19px;
  margin-bottom: 12px;
}

.profile-info div {
  margin: 4px 0;
  display: flex;
  justify-content: space-between;
}

.profile-preference {
  margin-top: 8px;
  font-size: 19px;
}

.radio-group {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radio-group label {
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pref-update-btn {
  margin-top: 16px;
  padding: 8px 16px;
  background-color: #007aff;
  color: white;
  font-size: 19px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
}

.pref-update-btn:hover {
  background-color: #005ecb;
}

.hidden {
  display: none !important;
}



.ticket-overlay .wrap-bus {
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 700px;
  min-height: 70vh;  
  max-height: 70vh;       /* fixed maximum height relative to viewport */
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 19px;
}

.profile-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
}

.profile-label {
  font-weight: bold;
}

.profile-value {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-row {
  min-height: 22px;  /* Equal to input height */
}

.edit-field {
  font-size: 19px;
  font-family: inherit;
  padding: 2px 6px;
  height: 22px;                /* 👈 Match approximate text height */
  line-height: 1.4;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}


.edit-control {
  margin-top: 6px;
  text-align: left;
}

.edit-control button {
  background: none;
  border: none;
  color: #007aff;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.bus-controls {
  padding: 12px 24px;
}
#bus-search {
  width: 100%;
  padding: 8px 12px;
  font-size: 19px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* Table */
.bus-table {
  width: 100%;
  border-collapse: collapse;
  flex-grow: 1;
  overflow-y: auto;
}
.bus-table thead {
  background: #f9f9f9;
}
.bus-table th, .bus-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 19px;
  border-bottom: 1px solid #eee;
}
.bus-table th {
  cursor: pointer;
  user-select: none;
}
.bus-table tbody tr:nth-child(even) {
  background: #fcfcfc;
}

/* Dropdown */
.status-select {
  padding: 6px 8px;
  font-size: 19px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
}

/* Actions */
.bus-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #eee;
}
.bus-actions button {
  padding: 8px 16px;
  font-size: 20px;
  border: none; border-radius: 6px;
  cursor: pointer;
}
#bus-cancel {
  background: #f5f5f5;
  color: #333;
}
#bus-cancel:hover {
  background: #e0e0e0;
}
#bus-submit {
  background: #007aff;
  color: #fff;
}
#bus-submit:hover {
  background: #005ecb;
}

.bus-table th, .bus-table td {
  padding: 12px 16px;
  font-size: 19px;
  border-bottom: 1px solid #eee;
}

.bus-table-wrapper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 24px;
  border: 1px solid #eee;
  border-radius: 4px;
}

/* Make the thead row stick at the top of the scrollable area */
.bus-table thead th {
  position: sticky;
  top: 0;
  background: #f9f9f9;  /* match your header background */
  z-index: 2;           /* above the body rows */
}

/* Optional: add a subtle bottom border on the header so it stands out */
.bus-table thead th {
  border-bottom: 2px solid #ddd;
}

.access-heading,
.bus-controls,
.bus-actions {
  flex-shrink: 0;
}
.bus-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;    /* lock in column widths */
}

/* Ensure no wrapping or overflow changes */
.bus-table th,
.bus-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Give each header a fixed width (adjust as needed) */
.bus-table th[data-sort="id"] {
  width: 300px;    /* enough for “Bus ID” + arrow */
}

.bus-table th[data-sort="availability"] {
  width: 200px;    /* enough for your dropdown and label */
}

.bus-table tr.status-available .bus-id {
  color: inherit;
}

/* Any unavailable state turns the ID red */
.bus-table tr.status-unavailable .bus-id {
  color: #e00; /* or your preferred red */
}

  .close {
    position: absolute;
    top: 160px;
    right: 100px;
    font-size: 60px;
    color: rgba(52,134,65,1);
    background-color: transparent;
    border-color: transparent;
  }