/*
 * Booking form, payment and payment status pages
 * (pages/booking/[id].js, pages/payment/[id].js, pages/paymentStatus/[id].js).
 *
 * antd pieces the shared theme.css has no look-alike for: Tabs
 * type="editable-card", Switch, Select size="small", TextArea showCount,
 * Upload listType="picture-card", Affix.
 */

/* Form.Item className="mb-0": theme.css loads after app.css, so the
   Tailwind class alone would lose against .an-field. */
.an-field.mb-0 {
  margin-bottom: 0;
}

/* Tabs type="editable-card" */
.an-tabs {
  font-size: 14px;
  line-height: 1.5714;
  color: rgba(0, 0, 0, 0.88);
}
.an-tabs__nav {
  position: relative;
  display: flex;
  margin: 0 0 16px;
}
.an-tabs__nav::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-bottom: 1px solid rgba(5, 5, 5, 0.06);
}
.an-tabs__list {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
}
.an-tabs__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(5, 5, 5, 0.06);
  border-radius: 8px 8px 0 0;
  outline: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.an-tabs__tab + .an-tabs__tab {
  margin-left: 2px;
}
.an-tabs__tab:hover .an-tabs__btn {
  color: var(--an-primary-hover);
}
.an-tabs__tab.is-active {
  background: #fff;
  border-bottom-color: #fff;
}
.an-tabs__tab.is-active .an-tabs__btn {
  color: var(--an-primary);
  text-shadow: 0 0 0.25px currentcolor;
}
.an-tabs__btn {
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  outline: none;
}
.an-tabs__btn:focus-visible {
  outline: 2px solid #91caff;
  outline-offset: 1px;
}
.an-tabs__remove {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  margin-right: -4px;
  padding: 0;
  background: transparent;
  border: none;
  color: rgba(0, 0, 0, 0.45);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}
.an-tabs__remove:hover {
  color: rgba(0, 0, 0, 0.88);
}
.an-tabs__pane[hidden] {
  display: none !important;
}

/* Switch */
.an-switch {
  position: relative;
  display: inline-block;
  min-width: 44px;
  height: 22px;
  line-height: 22px;
  vertical-align: middle;
  cursor: pointer;
}
.an-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.an-switch__track {
  display: block;
  width: 44px;
  height: 22px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.25);
  transition: background 0.2s;
  position: relative;
}
.an-switch:hover .an-switch__track {
  background: rgba(0, 0, 0, 0.45);
}
.an-switch__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px 0 rgba(0, 35, 11, 0.2);
  transition: left 0.2s ease-in-out;
}
.an-switch input:checked + .an-switch__track {
  background: var(--an-primary);
}
.an-switch:hover input:checked + .an-switch__track {
  background: var(--an-primary-hover);
}
.an-switch input:checked + .an-switch__track::after {
  left: calc(100% - 20px);
}
.an-switch input:focus-visible + .an-switch__track {
  outline: 4px solid #91caff;
  outline-offset: 1px;
}

/* Select size="small" */
.an-select.an-select-sm {
  display: inline-block;
  width: auto;
  min-width: 64px;
  height: 24px;
  padding: 0 24px 0 7px;
  border-radius: 4px;
  background-position: right 7px center;
  vertical-align: middle;
}

/* Input.TextArea showCount */
.an-textarea-count {
  position: relative;
}
.an-textarea-count__count {
  position: absolute;
  bottom: -22px;
  right: 0;
  color: rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  pointer-events: none;
}

/* Upload listType="picture-card" maxCount={1} */
.an-upload-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.an-upload-wrap .an-upload button {
  pointer-events: none;
  color: rgba(0, 0, 0, 0.88);
  font-size: 14px;
  padding: 0;
  background: none;
  font-family: inherit;
}
.an-upload:focus-within {
  border-color: var(--an-primary);
}
.an-upload-item {
  position: relative;
  width: 102px;
  height: 102px;
  padding: 8px;
  border: 1px solid var(--an-border);
  border-radius: 8px;
}
.an-upload-wrap [hidden] {
  display: none !important;
}
.an-upload-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.an-upload-item__status {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(0, 0, 0, 0.45);
  font-size: 14px;
}
.an-upload-item__actions {
  position: absolute;
  inset: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s;
}
.an-upload-item:hover .an-upload-item__actions,
.an-upload-item:focus-within .an-upload-item__actions {
  opacity: 1;
}
.an-upload-item__actions a,
.an-upload-item__actions button {
  display: inline-flex;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 16px;
  cursor: pointer;
}
.an-upload-item__actions a:hover,
.an-upload-item__actions button:hover {
  color: #fff;
}

/* Affix offsetTop={100}: sticky inside the grid column (which stretches
   to the height of the form column). */
.an-affix {
  position: sticky;
  top: 100px;
  z-index: 10;
}
