.schedule-table {
  border-collapse: collapse;
  margin: 0 auto 24px;
  max-width: none;
  width: max-content;
  min-width: 100%;
}

.schedule-table th,
.schedule-table td {
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.schedule-table thead th {
  font-weight: normal;
  color: #666;
  font-size: 0.65em;
  border: 1px solid #333;
}

.schedule-table thead th:first-child {
  width: 80px;
}

.schedule-table thead th.current-hour {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.15);
}

.schedule-table .current-hour-col {
  background-color: rgba(255, 255, 255, 0.05);
}

.schedule-table .current-hour-col-sul {
  background-color: rgba(100, 150, 255, 0.08);
}

.schedule-table td.day-cell {
  text-align: left;
  padding: 6px 10px;
  font-weight: bold;
  border: 1px solid #333;
  width: 80px;
  font-size: 0.8em;
  line-height: 1.4;
  color: #ccc;
}

.schedule-table td.day-cell .time-label {
  display: block;
}

.schedule-table td.day-cell .time-info {
  display: block;
  font-size: 0.9em;
  color: #aaa;
  margin-top: 2px;
}

.schedule-table .user-day-row td {
  background-color: rgba(100, 180, 255, 0.12);
}

.schedule-table .suluntulu-day-row td {
  background-color: rgba(255, 150, 100, 0.12);
}

.schedule-table .both-day-row td {
  background-color: rgba(100, 255, 100, 0.12);
}

.schedule-table th.hour-col {
  width: 28px;
  border: 1px solid #333;
}

.schedule-table thead tr:first-child th:first-child {
  border-right: 0;
}

.schedule-table .status-cell {
  border: 0;
  padding: 0;
  height: 32px;
}

.schedule-table .cell {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  cursor: pointer;
  transition: opacity 0.15s ease, filter 0.15s ease;
  box-sizing: border-box;
}

.schedule-table .cell.dimmed {
  opacity: 0.08;
}

.schedule-table .cell.highlighted {
  filter: brightness(1.2);
  border: 1px solid #fff;
  position: relative;
}

.schedule-table .cell.highlighted.has-left {
  border-left: 0;
}

.schedule-table .cell.highlighted.has-right {
  border-right: 0;
}

.schedule-table .cell:hover {
  filter: brightness(1.3);
}

.table-wrapper {
  position: relative;
}

.time-marker {
  position: absolute;
  top: 0;
  z-index: 10;
  cursor: default;
  height: 100%;
  pointer-events: auto;
  overflow: visible;
  transition: left 0.5s ease, top 0.5s ease, height 0.5s ease;
}

.time-marker .dot {
  display: block;
  position: absolute;
  left: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  transition: top 0.3s ease;
  border: 1px solid #000;
  box-sizing: border-box;
}

.time-marker .marker-hover-area {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.time-marker.local .dot {
  background-color: #8ab4f8;
}

.time-marker.sul .dot {
  background-color: #fff;
}

.time-marker.both .dot {
  background-color: #c58af9;
}

.time-marker .marker-label-top {
  position: absolute;
  left: 16px;
  font-size: 0.7em;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  transform: translateY(-50%);
  top: 50%;
}

.marker-label-top.hover-show {
  opacity: 1;
}

.time-marker:hover .marker-label-top {
  opacity: 1;
}

.status-1 { background-color: rgba(255, 255, 255, 0.1); }
.status-2 { background-color: rgba(255, 255, 255, 0.3); }
.status-3 { background-color: rgba(255, 255, 255, 0.5); }
.status-4 { background-color: rgba(255, 255, 255, 0.7); }
.status-5 { background-color: rgba(255, 255, 255, 0.9); }

.legend .selected .swatch {
  box-shadow: 0 0 0 2px #fff;
}

.legend {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aaa;
  user-select: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.legend li:hover {
  color: #fff;
}

.legend .swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 0;
  flex-shrink: 0;
  pointer-events: none;
}

@media (max-width: 480px) {
  .schedule-table {
    min-width: 100%;
  }
  .table-wrapper {
    overflow-x: auto;
  }
  .schedule-table th.hour-col {
    width: 18px;
    font-size: 0.55em;
  }
  .schedule-table td.day-cell {
    width: 60px;
    font-size: 0.7em;
    padding: 4px 6px;
  }
  .time-marker { display: none !important; }
  .status-1 { background-color: rgba(255, 255, 255, 0.06); }
  .status-2 { background-color: rgba(255, 255, 255, 0.2); }
  .status-3 { background-color: rgba(255, 255, 255, 0.35); }
  .status-4 { background-color: rgba(255, 255, 255, 0.55); }
  .status-5 { background-color: rgba(255, 255, 255, 0.75); }
  .schedule-table .cell.highlighted {
    border-width: 2px;
  }
}
