@import "variables";
@import "mixins";

// ----- HEADER SECTION RELATED STYLES ----- //
.cageeye-header-logo {
    display: flex;
    align-items: center;
    margin-right: 20px;

    .cageeye-logo {
        margin-right: 20px; // Adjust space to the right of the logo
    }

    .cageeye-title {
        display: flex;
        flex-direction: column;
        justify-content: space-between; // Space between titles
        min-width: 200px;
        color: $heading-font-color;

        .cageeye-title-big {
            font-size: 24px; // Adjust size if necessary
            margin-bottom: 8px; // Adjust vertical space between titles if necessary
        }

        .cageeye-title-small {
            font-size: 16px; // Adjust size if necessary
        }
    }
}

$header-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
    0 0 0 3px rgba(0, 126, 255, 0.1);

.header-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    height: 80px;
    position: -webkit-sticky; // Safari
    position: sticky;
    top: 0;
    padding: 0px 10px;
    background: $background-secondary;
    border-bottom: 1px solid $border-color;
    z-index: 999;

    .cageeye-header-options {
        justify-self: center;
    }

    .cageeye-logo,
    .profile-img {
        height: 48px;
        margin-right: 20px;
    }
    .cageeye-header__user {
        margin-right: 0;
        margin-left: auto;
    }
}

.cageeye-header-options-container {
    display: flex;
    height: 100%;
}

.date-picker-container {
    margin: auto 0;

    .DateInput {
        margin-right: 20px;

        &:first-child {
            margin-right: 30px;
        }

        &:last-child {
            margin-left: 15px;
        }
    }

    .DateInput_input {
        min-width: 150px;
        border-radius: 5px;
        text-align: center;
        line-height: 34px;
        border: none;
        box-shadow: $header-input-box-shadow;
        background-color: transparent;
        color: $heading-font-color;
        font-weight: 500;
        font-size: 16px;
        padding: 0 10px;

        &::placeholder,
        i {
            color: $placeholder-color !important;
        }

        &__focused {
            border: 2px solid $border-color;
        }
    }

    i {
        display: block;
        position: absolute;
        top: 13px;
        right: 11px;
        background-color: $background-secondary;
        pointer-events: none;
    }

    .DayPickerKeyboardShortcuts_show__bottomRight,
    .DateRangePickerInput__withBorder {
        display: none;
        border: none;
    }

    .DateRangePickerInput {
        background-color: transparent;
        display: inline-block;
        min-width: 350px;
        border-radius: 5px;
    }

    .DateRangePickerInput_arrow_svg {
        fill: $heading-font-color;
    }

    .DateInput {
        background-color: $background-secondary;
    }
}

.farm-cages-selection-container {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 15px;
    height: 80px;
}

.dropdown {
    position: relative;
    margin: 0 2px;
    padding: 23px 0;
    cursor: pointer !important;

    & > div {
        height: 100%;
        color: $heading-font-color;
        border: none;
        box-shadow: none;
    }
    .dropdown__label {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        margin: auto;
        line-height: 34px;
        padding: 0 10px;
        cursor: pointer;
        color: $heading-font-color;
        border-radius: 5px;
        box-shadow: $header-input-box-shadow;
    }

    .dropdown__content {
        display: none;
        position: absolute;
        height: auto;
        width: 100%;
        min-width: 100px;
        margin-top: 3px;
        flex: 1;
        border: 1px solid $border-color;
        background-color: $background-secondary;
        color: $heading-font-color;
        z-index: 10;
        box-sizing: border-box;

        &.dropdown__content--checklist {
            padding: 10px 5px;
            .dropdown__content__input {
                margin-right: 5px;
                margin-bottom: 8px;
            }
        }
    }

    &:hover .dropdown__content,
    &:active .dropdown__content,
    &:focus .dropdown__content,
    .dropdown__content:hover,
    .dropdown__content:active,
    .dropdown__content:focus {
        display: block;
    }
    .dropdown-item--label {
        width: 250px;
        color: inherit;
    }

    #meals-options-container, #cages-options-container {
        display: none;
        position: absolute;
        width: 100%;
        background-color: $background-secondary;
        border: 1px solid $border-color;
        box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
        z-index: 10;
        padding: 10px;
        border-radius: 5px;

        .button-multiselect-base {
            width: calc(100% - 20px);
            margin: 5px 0;
            display: block;

            &.button-multiselect-selected, &.button-multiselect-primary, &.button-multiselect-secondary {
                margin-bottom: 5px;
            }
        }
    }

    .dropdown-multiselect-button {
        min-width: 150px;
        white-space: nowrap;
        background-color: $background-secondary;
        color: $heading-font-color;
        border: 1px solid $border-color;
    }

    &:focus #meals-options-container,
    &:hover #meals-options-container,
    &:hover #cages-options-container,
    &:focus #cages-options-container {
        display: block;
    }
}

.farms-dropdown-container {
    width: 220px;

    .Select-control{
        border: 0; 
    }

    .Select-menu-outer {
        min-width: 250px;
        background-color: $background-secondary;
        max-height: none;
        border: none;
    }
}

.cages-sidebar {
    background-color: $background-secondary;
    width: 100%;
}

#cages-checklist-content label input[type="checkbox"] {
    margin: 5px 10px 0px 10px;
}

#meals-checklist-content label input[type="checkbox"] {
    margin: 5px 10px 0px 10px;
}

.header-section{
    .Select {
        height: 100%;
        border: none;
        box-shadow: none !important;
        cursor: pointer;
        &-control,
        &-multi-value-wrapper,
        &-value {
            height: 100%;
            width: 100%; // Ensuring that it takes the full width
            color: inherit !important;
            cursor: pointer;
            div,
            input,
            span,
            & {
                background-color: inherit !important;
                border: 0;
            }
        }
        &-control {
            border-radius: 5px;
            box-shadow: $header-input-box-shadow;
        }

        .Select-value-label {
            color: inherit !important;
        }
        .Select-arrow-zone {
            .Select-arrow {
                border-color: white transparent transparent;
                border-style: solid;
                border-width: 5px 5px 2.5px;
            }
            &:hover .Select-arrow,
            &:active .Select-arrow,
            &:focus .Select-arrow {
                border-color: $heading-font-color transparent transparent !important;
            }
        }
        &.is-open {
            .Select-arrow {
                top: -2px;
                border-width: 0 5px 5px;
                border-color: transparent transparent white;
            }
            &:hover .Select-arrow,
            &:active .Select-arrow,
            &:focus .Select-arrow {
                border-color: transparent transparent $heading-font-color !important;
            }
        }

        &-menu-outer {
            width: 200px;
            background-color: $background-secondary;
            border: none;
            box-shadow: none;

            .Select-menu__item {
                width: 100%;
            }
            .Select-menu__headeritem {
                width: 100%;
                font-weight: bold;
                font-size: small;
                color: white;

            }
            .Select-menu__subitem {
                width: 100%;
                padding-left:2ch;
            }
        }
        
        input {
            color: inherit !important;
        }
    }
} 

.units-paragraph {
    padding: 15px 20px;
    text-align: justify;
    border: 2px solid lighten($background-primary, 10%);
    border-radius: 8px;
    background-color: rgba($background-primary, 0.6);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;

    text-transform: none;
    font-weight: 400;
    letter-spacing: 0.5px;
}


.units-paragraph {
    padding: 15px 20px;
    text-align: justify;
    border: 2px solid lighten($background-primary, 10%);
    border-radius: 8px;
    background-color: rgba($background-primary, 0.6);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;

    text-transform: none;
    font-weight: 400;
    letter-spacing: 0.5px;
}




.button-pair-multiselect-container {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.button-multiselect-base {
  width: 100%;
  padding: 0rem;
  border-radius: 0.25rem;
  font-size: 18px;
  line-height: 1.5;
  cursor: pointer;
  margin: 0.125rem;
  text-align: center;
  border: 1px solid transparent;
  color: $heading-font-color;
  background-color: transparent;
  transition: background-color 0.4s ease, color 0.4s ease;

  &.button-multiselect-primary {
    background-color: transparent; // No background by default
  }

  &.button-multiselect-secondary {
    background-color: transparent; // No background by default
    &:hover {
      background-color: darken($blue4, 10%); // Slight darkening on hover
      color: white;
    }
  }

  &.button-multiselect-selected {
    background-color: $sidebar-font-color-active;
    color: white;
  }
}


.button-multiselect-primary {
  flex: 0 0 80%; // flex-grow, flex-shrink, flex-basis
}

.button-multiselect-secondary {
  flex: 0 0 20%; // flex-grow, flex-shrink, flex-basis
}

.selectAll-multiselect-btn {
  background-color: transparent;
  color: $heading-font-color;
  font-size: 18px;
  width: 100%;
  border-radius: 0.25rem;
    border: 1px solid $border-color;
  &:hover {
    background-color: $sidebar-font-color-active;
    color: white;
  }
}


@keyframes slideInOut {
    0%, 100% { transform: translateY(-50%) rotate(-90deg) translateX(10px); }
    50% { transform: translateY(-50%) rotate(-90deg) translateX(0); }
}

.development-banner {
    position: absolute;
    right: -25vh;
    top: 50vh;
    z-index: 1000;
    background-color: $orange6;
    color: black;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 14px;
    font-family: 'Press Start 2P', cursive;
    font-weight: bold;
    cursor: pointer;
    animation: slideInOut 3s infinite ease-in-out;
    text-orientation: mixed;
    max-height: 60px;
    max-width: 80vh;
    text-align: center;
}

.lang-radio .form-check {
    padding: 7px 10px;
    text-align: justify;
    border: 2px solid lighten($background-primary, 10%);
    border-radius: 8px;
    background-color: rgba($background-primary, 0.6);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;

    text-transform: none;
    font-weight: 400;
    letter-spacing: 0.5px;
    display: flex;
    border: 2px solid lighten($background-primary, 10%);
    justify-content: space-between;
    margin: 0.4rem;
    background-color: rgba($background-primary, 0.6)
}

.lang-radio .form-check-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 1.2em;
  height: 1.2em;
  margin-left: 0em;
  background-clip: content-box;
  padding: 2px;
  border: 1px solid var(--bs-gray-400);
  border-radius: 1em;
  background-color: var(--bs-white);
}

.lang-radio .form-check-input:checked {
  background-color: rgb(0, 182, 189);
}

.lang-radio .form-check-input:checked::after {
  content: '';
  display: block;
  margin-left: auto;
  width: 9px;
  height: 9px;
  border-radius: 80%;
//   background-color: var(--bs-white);
}

.lang-radio  .form-check-input:checked + .form-check-label {
  font-weight: bold;
}

.maintenance-section {
    width: 100%;
    height: 30px;
    position: -webkit-sticky; // Safari
    position: sticky;
    bottom: 0px;
    padding: 0px 10px;
    background: $orange6;
    color: black;
    border-bottom: 1px solid $border-color;
    z-index: 999;    
    margin: auto;

    .maintenance-text{
        color: black;
        text-transform: uppercase;
    }
}

// Sentry

//opacity on feedback button
#sentry-feedback {
    opacity: 0.6;
    &:hover{
        opacity: 1;
    }
  }

//move dash debug menu a little higher to make room for sentry button
.dash-debug-menu {
    bottom: 85px !important;
}
.dash-debug-menu__outer{
    &--closed{
        bottom: 85px !important;
    }
    &--open{
        bottom: 78px !important;
    }
}
