/**
* Copyright (c) 2022 - present TinyVue Authors.
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

@import '../custom.less';

@date-picker-prefix-cls: ~'@{css-prefix}date-picker';

.@{date-picker-prefix-cls} {
  width: 360px;

  &.has-sidebar.has-time {
    width: 434px;
  }

  &.has-sidebar {
    width: 525px;
  }

  &.has-time {
    .@{picker-panel-prefix-cls}__body-wrapper {
      @apply relative;
    }
  }

  table {
    @apply table-fixed;
    @apply w-full;
  }

  &__header {
    @apply p-4;
    @apply h-12;
    @apply text-center;
  }

  &__header--bordered {
    @apply mb-0;
    @apply pb-3;

    & + .@{picker-panel-prefix-cls}__content {
      @apply mt-0;
    }
  }

  &__header-label {
    @apply text-xs;
    @apply font-medium;
    @apply py-0 px-1;
    @apply text-center;
    @apply cursor-pointer;
    @apply text-color-text-primary;
    @apply align-middle;

    &.active,
    &:hover {
      @apply text-color-brand;
    }
  }

  &__prev-btn {
    @apply float-left;
  }

  &__next-btn {
    float: right;
  }

  &__time-wrap {
    @apply ~'p-2.5';
    @apply text-center;
  }

  &__time-label {
    @apply float-left;
    @apply cursor-pointer;
    line-height: 30px;
    @apply ~'ml-2.5';
  }
}

.@{date-picker-prefix-cls},
.@{date-range-picker-prefix-cls} {
  &__time-header {
    @apply relative;
    @apply text-xs;
    @apply h-10;
    @apply leading-10;
    @apply table;
    @apply w-full;
    @apply box-border;
    @apply border-b border-b-color-bg-3;
  }

  &__editors-wrap:first-child {
    @apply border-r border-r-color-bg-3;
    @apply relative;
    @apply -left-px;
  }

  &__editor-wrap,
  &__time-picker-wrap {
    @apply relative;
    @apply table-cell;
    padding: 0 5px;

    &:first-child::before {
      @apply content-[''];
      @apply h-6;
      @apply absolute;
      @apply right-0;
      @apply top-2;
      @apply border-r border-r-color-bg-3;
    }

    .@{input-prefix-cls}__inner {
      @apply border-0;
      @apply text-center;
      @apply text-color-text-primary;
    }
  }
}
