/*
 * VM-Operator
 * Copyright (C) 2023 Michael N. Lipp
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program 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
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

/*
 * Conlet specific styles.
 */
 
.jdrupes-vmoperator-vmmgmt-preview {
  form {
    float: right;
    padding: 0.15em 0.3em;
    border: 1px solid var(--panel-border);
    border-radius: var(--corner-radius);    
  }

  table {
    margin-bottom: 1em;
  }

  .vmsChart-wrapper {
    height: 12em;
  }    
}
 
.jdrupes-vmoperator-vmmgmt-view-search {
  display: flex;
  justify-content: flex-end;
  
  form {
    white-space: nowrap;
  }
}

.jdrupes-vmoperator-vmmgmt-view-table {
  td {
    vertical-align: top;

    &[tabindex] {
      outline: 1px solid var(--primary);
      cursor: text;
    }
    
    &:not([colspan]):first-child {
      white-space: nowrap;
    }

    &.column-running {
      text-align: center;

      span {
        &.fa-check {
          color: var(--success);
        }

        &.fa-close {
          color: var(--danger);
        }
      }
    }
    
    .console-conection-closed {
      color: var(--disabled);
    }
  }
  
  td.details {
    padding-left: 0;

    table {
      display: inline-block;
      
      td:nth-child(2) {
        min-width: 7em;

        input {
          max-width: 5em;
        }  
      }
      
      input~span {
        margin-left: 0.5em;
        color: var(--danger);
      }
    }
    
    p {
      display: inline-block;
      margin: 0.25rem 0.5rem 0.25rem 0.5rem;
      vertical-align: top;
    }
  }
}

.jdrupes-vmoperator-vmmgmt-view-action-list {
  white-space: nowrap;

  & > * + * {
      margin-left: 0.5em;
  }
  
  [role=button] {
    padding: 0.25rem;

    &:not([aria-disabled]):hover, &[aria-disabled='false']:hover {
      box-shadow: var(--darkening);
    }
  }

  span[role="button"].svg-icon {
    display: inline-block;
    line-height: 1;

    /* Align with forkawesome */
    font-size: 14px;
    fill: var(--primary);

    &[aria-disabled="true"], &[aria-disabled=""] {
      fill: var(--disabled);
    }
    
    svg {
      height: 2ex;
      width: 1em;
    }
  }

  img {
    display: inline;
    height: 1.5em;
    vertical-align: top;
    
    &[aria-disabled=''], &[aria-disabled='true'] {
        opacity: 0.4;
    }
  }
}

.jdrupes-vmoperator-vmmgmt.jdrupes-vmoperator-vmmgmt-confirm-reset {

  [role=button] {
    padding: 0.25rem;

    &:not([aria-disabled]):hover, &[aria-disabled='false']:hover {
      box-shadow: var(--darkening);
    }
  }
    
  span[role="button"].svg-icon {
    display: inline-block;
    line-height: 1;
    /* Align with forkawesome */
    font-size: 14px;
    fill: var(--danger);
    
    &[aria-disabled="true"], &[aria-disabled=""] {
      fill: var(--disabled);
    }
      
    svg {
      width: 2.5em;
      height: 2.5em;
    }
  }
    
  p {
    text-align: center;
  }
}
