body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  margin: 0;
}

.table-container {
  overflow: auto;
  max-height: 80vh;
  border: 1px solid #ccc;
}

table.schedule {
  border-collapse: collapse;
  width: 100%;
  background-color: #fff;
  table-layout: fixed;
}

.schedule th,
.schedule td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule th:first-child {
  width: 100px;
  font-weight: bold;
  background-color: #f2f2f2;
}

.schedule td:first-child {
  width: 100px;
  font-weight: bold;
  /* background-color: #f2f2f2; */
}

.schedule th:not(:first-child) {
  background-color: #f2f2f2;
}

.schedule th:not(:first-child),
.schedule td:not(:first-child) {
  width: 120px;
}

.slot.available {
  background-color: #ffffff;
  cursor: pointer;
}

.slot.booked {
  background-color: #fa5000;
  cursor: not-allowed;
  color: white;
}

.slot.selected {
  background-color: #4caf50;
  color: white;
}

#popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

#popup h3 {
  margin-top: 0;
  margin-bottom: 16px;
}

#popup label {
  display: block;
  margin-top: 12px;
  font-weight: bold;
  color: #333;
}

#popup input[type="date"],
#popup select,
#popup textarea {
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

#popup textarea {
  resize: vertical;
  min-height: 80px;
}

#popup #check-btn {
  margin-top: 10px;
  padding: 10px 16px;
  background-color: #fa5000;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#popup #check-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

#popup #check-btn:hover:enabled {
  background-color: #fb6a26;
}

#popup .close-btn {
  background-color: #ccc;
  margin-left: 10px;
}

#popup button {
  padding: 12px 20px;
  background-color: #fa5000;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s;
  margin-top: 16px;
}

#popup button:hover {
  background-color: #fb6a26;
}

#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 999;
}

.popup-flex-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.input-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.booking-label {
  font-weight: bold;
  margin-bottom: 4px;
  color: #333;
}

#booking-info {
  height: 40px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

/* ✅ 直接美化 select，不包 input-box，避免双边框 */
#duration {
  height: 40px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: white;
  font-family: Arial, sans-serif;
  appearance: none; /* 去掉默认箭头 */
  background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='10' viewBox='0 0 20 20' width='10' xmlns='http://www.w3.org/2000/svg'><polygon points='0,0 20,0 10,10'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  margin: 0px !important;
}

/* 📱 Mobile View */
@media (max-width: 768px) {
  .table-container {
    max-height: none;
    overflow-x: auto;
  }

  table.schedule {
    font-size: 12px;
  }

  .schedule th:first-child,
  .schedule td:first-child {
    width: 80px;
  }

  .schedule th:not(:first-child),
  .schedule td:not(:first-child) {
    width: 100px;
  }

  #popup {
    width: 90%;
    padding: 16px;
  }

  #popup h3 {
    font-size: 18px;
  }

  #popup input[type="date"],
  #popup select,
  #popup textarea,
  #booking-info {
    font-size: 14px;
  }

  .popup-flex-row {
    flex-direction: column;
    gap: 8px;
  }

  #popup button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
  }

  #popup .close-btn {
    margin-left: 0;
    margin-top: 8px;
  }
}
