/*
 * Copyright (C) 2017-2019 Dremio Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
@import "~#oss/uiTheme/less/variables.less";
@import "~#oss/uiTheme/less/mixins.less";

@icon-w: 24px - 10px;

:global {
  #branchPickerPopover {
    z-index: 1300; // Show above toast notifications
    .MuiPaper-root {
      overflow: hidden !important; // Popover paper showing overflow
    }
  }

  .branchPicker {
    cursor: pointer;
    user-select: none;
    .flex-center;
  }

  .branchPicker-popup {
    box-shadow: var(--dremio--shadow--layer-1);
    border-radius: 4px;

    .dremio-dialog-content__main {
      padding-inline: 8px !important;
      padding-block: 8px !important;
    }

    &,
    .MuiTypography-body1 {
      font-size: 14px;
    }

    max-height: 95vh;
    background-color: var(--fill--popover);

    display: flex;
    flex-direction: column;

    &-content {
      display: flex;
      flex-direction: column;

      min-height: 0;
      flex: 1;
    }

    .branchesView {
      width: 650px;
      height: 500px;
      overflow: hidden;
      .react-datepicker {
        font-size: 12px;
      }
      .react-datepicker__current-month,
      .react-datepicker-time__header,
      .react-datepicker-year-header {
        font-size: 12px;
      }
      .react-datepicker__day-name,
      .react-datepicker__day,
      .react-datepicker__time-name {
        width: 40px;
        line-height: 30px;
      }

      .react-datepicker-wrapper {
        padding-top: 4px;
        input {
          border-color: var(--border--neutral--solid);
        }
      }
      .react-datepicker-popper {
        z-index: 5;
      }
    }

    .commitBrowser {
      padding-top: 4px;
    }

    .field.disabled {
      opacity: 0.4;
    }

    .branchesView {
      &-left {
        width: 33.3%;
        border-right: 1px solid var(--border--neutral);
      }
      &-right {
        width: 66.7%;
        padding: 0 0 12px 15px;
      }
      &-left,
      &-right {
        height: 100%;
        display: inline-block;
        vertical-align: top;
      }

      &-radios {
        .MuiRadio-root {
          padding: 4px !important;
          margin-right: 4px;
          margin-top: 2px;
        }
      }

      &-radios,
      .MuiFormGroup-root {
        width: 100%;
        height: 100%;
      }

      .MuiFormControlLabel-root {
        width: 100%;
        align-items: flex-start;
      }

      .MuiFormControlLabel-label {
        padding-top: 3px;
      }

      &-commitBrowserContainer {
        flex: 1;
        align-items: flex-start;
        .MuiFormControlLabel-label {
          height: 100%;
        }
      }

      &-radioLabel {
        width: 100%;
        margin-bottom: 16px;

        .MuiFormControlLabel-label {
          flex: 1;
          display: flex;
          flex-direction: column;
        }

        .MuiFormControlLabel-root {
          margin-left: -4px !important;
          margin-right: 0 !important;
        }
      }
    }
  }
}
