/*
  Copyright 2018 Red Hat Inc.

  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.
 */

.network-topology {
  display: grid;
  grid-template-columns: 1fr 200px 1fr;
  align-content: start;
  background: #f8f8f8;
  padding: 15px;
  height: 100%;
  overflow: auto;

  .roles-list {
    display: flex;
    justify-content: space-evenly;
    margin-bottom: 20px;
  }

  .role-card {
    text-align: center;
    margin: 0 5px;
    padding: 0 10px;
    .card-pf-title {
      margin-top: 10px;
    }
    .card-pf-body {
      padding: 0 0 10px;
    }
    .card-pf-footer {
      margin: 0px -10px !important;
      padding: 5px;
    }
  }

  .role-networks-list {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    .role-nic {
      position: relative;
      background: grey;
      width: 10px;
      height: 10px;
      margin: 0 1px;
      .role-network-line {
        height: 1px;
        position: absolute;
        bottom: 0;
        left: 50%;
        border-right: 1px solid;
        background-color: inherit;
        transform: rotateX(90deg);
        transform-origin: top center;
        transition: transform .5s ease-in, opacity .3s ease-in;
        opacity: 0;
        &.in {
          transition: transform .1s ease-in;
          transform: rotateX(0deg);
          opacity: 1
        }
        &.highlighted {
          transform: scaleX(3);
        }
      }
      .role-network-point {
        position: absolute;
        z-index: 1;
        bottom: 0;
        left: 50%;
        margin-left: -4px;
        width: 9px;
        height: 9px;
        border-radius: 5px;
        border: 1px solid;
        opacity: 0;
        transition: transform .1s ease-in, opacity .5s .3s ease-in;
        &.highlighted {
          transform: scale(1.2);
        }
      }
    }
  }

  .network-line {
    grid-column: ~"1 / 4";
    position: relative;
    margin: 20px 9px 0 9px;
    .network-line-edge {
      transition: transform .1s ease-in;
      border-top: 1px solid;
    }
    .network-line-ends {
      &:before, &:after {
        content: "";
        position: absolute;
        top: -4px;
        width: 9px;
        height: 9px;
        border-radius: 5px;
        border: 1px solid;
        border-color: inherit;
        transition: transform .1s ease-in;
      }
      &:before { left: -9px; }
      &:after { right: -9px; }
    }
    &.highlighted {
      .network-line-edge {
        transform: scaleY(3);
      }
      .network-line-ends {
        &:before, &:after {
          transform: scale(1.3);
        }
      }
    }
  }

  .network {
    grid-column: ~"2 / 3";
    text-align: center;
    color: white;
    padding: 3px 8px;
    box-shadow: 0 1px 1px rgba(3, 3, 3, 0.175);
    &:hover {
      box-shadow: 0 1px 6px rgba(3, 3, 3, 0.35);
    }
    h5 {
      margin: 5px 0;
    }
  }
}