/*****************************************************************************
 * Open MCT, Copyright (c) 2014-2024, United States Government
 * as represented by the Administrator of the National Aeronautics and Space
 * Administration. All rights reserved.
 *
 * Open MCT is 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.
 *
 * Open MCT includes source code licensed under additional open source
 * licenses. See the Open Source Licenses file (LICENSES.md) included with
 * this source code distribution or the Licensing information page available
 * at runtime from the About dialog for additional information.
 *****************************************************************************/

.c-indicator {
  &:before {
    // Indicator icon
    color: $colorKey;
  }

  &--user {
    max-width: max-content;
    &.clickable {
      cursor: pointer;

      @include hover() {
        background: $colorIndicatorBgHov;
      }
    }
  }
}

$statusCountWidth: 30px;

.c-user-control-panel {
  @include menuOuter();
  display: flex;
  flex-direction: column;
  padding: $interiorMarginLg;
  min-width: max-content;
  max-width: 35%;

  > * + * {
    margin-top: $interiorMarginLg;
  }

  *:before {
    font-size: 0.8em;
    margin-right: $interiorMarginSm; // WTF - this is BAD!
  }

  &__section {
    display: flex;
    align-items: center;
    flex-direction: row;

    > * + * {
      margin-left: $interiorMarginLg;
    }
  }

  &__header {
    align-items: center;
    display: flex;
    column-gap: $interiorMargin;
    text-transform: uppercase;

    > * {
      flex: 0 0 auto;
    }

    [class*='title'] {
      flex: 1 1 auto;
    }
  }

  .t-close-btn {
    &:before {
      margin-right: 0;
    }
  }

  &__component {
    // General classes for new control panel component
    display: flex;
    flex-direction: column;
    gap: $interiorMargin;
  }

  &__top {
    text-transform: uppercase;
  }

  &__user-role,
  &__updated {
    opacity: 50%;
  }

  &__updated {
    flex: 1 1 auto;
    text-align: right;
  }

  &__poll-question {
    background: $colorBodyFg;
    color: $colorBodyBg;
    border-radius: $controlCr;
    font-weight: bold;
    padding: $interiorMarginSm $interiorMargin;

    .c-user-control-panel--admin & {
      background: rgba($colorBodyFg, 0.1);
      color: $colorBodyFg;
    }
  }

  /*************************************************** ADMIN INTERFACE */
  &__content {
    $m: $interiorMargin;
    display: grid;
    grid-template-columns: max-content 1fr;
    grid-column-gap: $m;
    grid-row-gap: $m;

    [class*='__label'] {
      padding: 3px 0;
    }

    [class*='__label'] {
      padding: 3px 0;
    }

    [class*='__poll-table'] {
      grid-column: span 2;
    }

    [class*='new-question'] {
      align-items: center;
      display: flex;
      flex-direction: row;
      > * + * {
        margin-left: $interiorMargin;
      }

      input {
        flex: 1 1 auto;
        height: $btnStdH;
      }

      button {
        flex: 0 0 auto;
      }
    }
  }
}

/**************** STYLES FOR THE MISSION STATUS USER CONTROL PANEL */
.c-ucp-mission-status {
  $bg: rgba(black, 0.7);
  display: grid;
  grid-template-columns: max-content max-content 1fr;
  align-items: center;
  grid-column-gap: $interiorMarginLg;
  grid-row-gap: $interiorMargin;

  &__widget {
    border-radius: $basicCr;
    background: $bg;
    border: 1px solid transparent;
    padding: $interiorMarginSm $interiorMarginLg;
    text-align: center;

    &.--is-go {
      $c: #2c7527;
      background: $c;
      color: white;
    }

    &.--is-no-go {
      $c: #fbc147;
      background: $bg;
      border: 1px solid $c;
      color: $c;
    }
  }
}
