/* Table Wrapper */
.table-wrapper {
  width: 100%;
  margin-top: 20px;
  position: relative;
}

/* Table Scrollbars */
.table-scrollbar-top,
.table-scrollbar-bottom {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  height: 17px;
  margin-bottom: 5px;
}

.table-scrollbar-bottom {
  margin-top: 5px;
  margin-bottom: 0;
}

.table-scrollbar-top::-webkit-scrollbar,
.table-scrollbar-bottom::-webkit-scrollbar {
  height: 12px;
}

.table-scrollbar-top::-webkit-scrollbar-track,
.table-scrollbar-bottom::-webkit-scrollbar-track {
  background: var(--light);
  border-radius: 6px;
}

.table-scrollbar-top::-webkit-scrollbar-thumb,
.table-scrollbar-bottom::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}

.table-scrollbar-top::-webkit-scrollbar-thumb:hover,
.table-scrollbar-bottom::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Table Container */
.table-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Hide scrollbar but keep functionality */
  -ms-overflow-style: none;
}

.table-container::-webkit-scrollbar {
  display: none; /* Hide scrollbar but keep functionality */
}

/* Tables (Admin) */
table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
  background: var(--bg-white);
  border-radius: 8px;
  overflow: hidden;
}

thead {
  background: var(--bg-light-green);
}

th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--dark);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  word-wrap: break-word;
  max-width: 200px;
  vertical-align: top;
}

tbody tr:hover {
  background: var(--light);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Admin Header */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.admin-header h2 {
  margin: 0;
}

.btn-refresh {
  padding: 8px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-refresh:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-refresh:active {
  transform: translateY(0);
}

/* Admin Add Form */
.admin-add-form {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--bg-white);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.admin-add-form input[type="date"],
.admin-add-form input[type="time"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  width: auto;
  min-width: 150px;
}

.admin-add-form label {
  font-weight: 500;
  color: var(--dark);
  font-size: 0.9rem;
}

.admin-add-form button {
  padding: 8px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

.admin-add-form button:hover {
  background: var(--primary-dark);
}

/* Booking Status */
.booking-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: capitalize;
}

.booking-status.pending,
.booking-status:empty {
  background: #fff3cd;
  color: #856404;
}

.booking-status.confirmed {
  background: #d4edda;
  color: #155724;
}

.booking-status.canceled {
  background: #f8d7da;
  color: #721c24;
}

/* Admin Actions */
.admin-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.admin-actions form {
  margin: 0;
}

.admin-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-confirm {
  background: #28a745;
  color: white;
}

.btn-confirm:hover {
  background: #218838;
}

.btn-cancel {
  background: #dc3545;
  color: white;
}

.btn-cancel:hover {
  background: #c82333;
}

.btn-delete {
  background: #6c757d;
  color: white;
}

.btn-delete:hover {
  background: #5a6268;
}

/* Admin Controls */
.admin-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--bg-white);
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 15px;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-controls label {
  font-weight: 500;
  color: var(--dark);
  font-size: 0.95rem;
}

.sort-controls select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  background: white;
  cursor: pointer;
  min-width: 150px;
}

.sort-controls select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--text);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--dark);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-block;
}

.pagination-btn:hover:not(.disabled):not(.active) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--light);
}

.pagination-ellipsis {
  padding: 8px 4px;
  color: var(--text);
}

/* Expandable fields */
.btn-expandable-toggle {
  padding: 4px 10px;
  background: #17a2b8;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.btn-expandable-toggle:hover {
  background: #138496;
}

.expandable-details {
  margin-top: 8px;
  padding: 10px;
  background: var(--light);
  border-radius: 6px;
  border: 1px solid var(--border);
  max-width: 300px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.expandable-content {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.expandable-content strong {
  color: var(--dark);
  font-weight: 600;
}

.expandable-content a {
  color: var(--primary);
  text-decoration: none;
}

.expandable-content a:hover {
  text-decoration: underline;
}

.no-data {
  color: var(--text-muted);
  font-style: italic;
}
