@import 'calendar.css';

.booking-list__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.booking-list__filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.booking-list__filters .select-field,
.booking-list__filters .date-picker {
  width: auto;
  flex: 0 0 auto;
}

.booking-list__filters .search-field {
  flex: 1 1 200px;
  min-width: 200px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0 12px;
  min-height: 42px;
  background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 184, 179, 0.12);
}

.search-field__icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-field__input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  width: 100%;
  min-height: 40px;
}

.search-field__input::placeholder {
  color: var(--text-muted);
}

.date-picker {
  position: relative;
}


.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.pagination__buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination__info {
  padding: 0 8px;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.button--icon {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 0.8rem;
}

.date-picker__trigger {
  display: flex;
  align-items: center;
  min-height: 42px;
  min-width: 150px;
  text-align: left;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.date-picker__trigger:hover {
  border-color: var(--accent);
}

.date-picker__trigger--active {
  color: var(--text);
}

.date-picker__popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  width: 280px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.date-picker__clear {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.date-picker__clear:hover {
  background: var(--line);
}

.booking-owner--me {
  color: var(--accent-ink);
  font-weight: 700;
}

.booking-list__row-actions {
  display: contents;
}

.booking-list__action-label--short {
  display: none;
}

#rowEditBtn,
#rowParticipantsBtn {
  display: none;
}

.booking-table-wrap {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.icon-btn:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
  color: var(--accent-ink);
}

.data-table th:last-child,
.data-table td:last-child {
  width: 100px;
  white-space: nowrap;
  text-align: right;
}

.data-table td:last-child .icon-btn + .icon-btn {
  margin-left: 4px;
}

#editModal .modal__content {
  max-width: 400px;
}

#participantsModal .modal__content {
  max-width: 340px;
}

#editModal .modal__header {
  padding: 14px 24px;
}

#editModal .modal__body {
  padding: 10px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#editModal .time-range-picker {
  margin-bottom: 0;
}

#editModal .booking-modal__date-picker {
  margin-bottom: 10px;
}

#editModal .booking-modal__range {
  margin-top: 8px;
}

.booking-modal__date-trigger {
  gap: 6px;
  margin-left: -8px;
  padding: 4px 8px;
  min-height: auto;
  min-width: auto;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  transition: background-color 150ms ease;
}

.booking-modal__date-trigger:hover {
  background: var(--surface-soft);
}

.booking-modal__date-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

#editModal .form {
  gap: 8px;
}

#editModal .form__input {
  min-height: 38px;
}

.participants-view-list {
  display: grid;
  gap: 0;
}

.participants-view-list__item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--text);
}

.participants-view-list__item:last-child {
  border-bottom: none;
}

.participants-view-list__empty {
  padding: 10px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .booking-list__toolbar {
    margin-bottom: 12px;
  }

  .booking-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table__head,
  .data-table__cell {
    padding: 10px 10px;
  }
}

@media (max-width: 700px) {
  .booking-list__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .booking-list__toolbar .button {
    align-self: flex-end;
  }
}

@media (max-width: 600px) {
  .booking-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table th:nth-child(2),
  .data-table td:nth-child(2) {
    display: none;
  }

  .data-table th:nth-child(1),
  .data-table td:nth-child(1),
  .data-table th:nth-child(6),
  .data-table td:nth-child(6) {
    display: none;
  }

  .booking-list__action-label--full {
    display: none;
  }

  .booking-list__action-label--short {
    display: inline;
  }

  .booking-list__row-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
    max-width: 100%;
  }

  .booking-list__row-actions .button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 6px;
    font-size: 0.78rem;
    white-space: normal;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }

  #rowEditBtn,
  #rowParticipantsBtn {
    display: inline-flex;
  }

  .data-table tbody .data-table__row {
    cursor: pointer;
  }

  .data-table__head,
  .data-table__cell {
    padding: 10px 6px;
    font-size: 0.85rem;
  }

  .data-table {
    table-layout: fixed;
  }

  .data-table__head {
    white-space: normal;
  }

  .data-table__cell {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .data-table th:nth-child(1) {
    width: 32px;
  }

  .data-table th:nth-child(3) {
    width: 38%;
  }

  .data-table th:nth-child(4) {
    width: 32%;
  }

  .data-table th:nth-child(5) {
    width: 30%;
  }

  .booking-list__filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .booking-list__filters .select-field,
  .booking-list__filters .date-picker {
    width: 100%;
    min-width: 0;
  }

  .booking-list__filters .date-picker__trigger {
    min-width: 0;
    width: 100%;
  }

  .booking-list__filters .search-field {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }

  #dateFilterPicker .date-picker__popover {
    left: auto;
    right: 0;
    width: calc(200% + 8px);
  }
}

.data-table__label--short {
  display: none;
}

@media (max-width: 360px) {
  .booking-list__row-actions .button {
    padding: 0 4px;
    font-size: 0.7rem;
  }

  .data-table__label--full {
    display: none;
  }

  .data-table__label--short {
    display: inline;
  }
}
