@import "../shared/styles/tl-variables.scss";

:host {
  font-family: var(--tl-font-family-sans-serif);
  --tl-mobile-display-max-height: 1500px;

  .dropdown-menu-sections {
    margin: 0px 0px;
  }

  wvr-dropdown-component {
    ::ng-deep {
      .wvr-dropdown .dropdown {
        .btn.btn-link.dropdown-toggle,
        .btn.btn-link:not(:disabled):not(.disabled).active,
        .btn.btn-link:not(:disabled):not(.disabled):active {
          text-decoration: none !important;
          color: var(--tl-black) !important;
        }

        .btn {
          width: 100%;

          .menu-title {
            display: inline;
          }

          a.menu-title:focus-within,
          a.menu-title:hover {
            text-decoration: none !important;
            color: var(--tl-white) !important;
          }

          tl-icon-component.x-icon svg {
            transition: transform 0.25s ease-in-out;
            transform: rotate(0deg);
          }

          tl-icon-component.plus-icon svg {
            transition: transform 0.25s ease-in-out;
            transform: rotate(0deg);
          }
        }
      }
    }
  }

  wvr-dropdown-component:focus-within,
  wvr-dropdown-component:hover {
    ::ng-deep {
      .wvr-dropdown .dropdown {
        .btn {
          tl-icon-component.x-icon svg {
            transition: transform 0.25s ease-in-out;
            transform: rotate(90deg);
          }
        }
      }
    }
  }

  wvr-dropdown-component.active {
    ::ng-deep {
      .wvr-dropdown .dropdown {
        .btn {
          tl-icon-component.plus-icon svg {
            transition: transform 0.25s ease-in-out;
            transform: rotate(45deg);
          }
        }
      }
    }
  }

  .mobile-display {
    max-height: 0px;
    overflow: hidden;
    transition: max-height 1s ease-in-out;
    background: var(--tl-grey);

    ::ng-deep {
      tl-dropdown-menu-section-component,
      tl-dropdown-menu-section {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0px;

        .section-content .navbar-nav tl-nav-li {
          cursor: pointer;
          margin: 0px 15px 0px 30px;
          padding: 20px 0px;
          text-align: start;
          color: var(--tl-black);
          font-size: 17px;
          font-family: var(--tl-font-family-sans-serif);
          font-weight: 300;
          border-bottom: 0.5px solid #e4e4e4;
          text-decoration: none;

          > a {
            padding: 0px;
            margin-bottom: 0x;
            color: inherit;
            font-weight: inherit;
            width: 100%;
            display: block;
          }

          > a:focus-within,
          > a:hover {
            font-weight: inherit;
            color: inherit;
            background: inherit;
            text-decoration: none;
          }

          wvre-text {
            display: flex;
            font-weight: 300;
            padding: 0px;
            margin: 0px;
          }
        }

        .section-content .navbar-nav tl-nav-li:focus-within,
        .section-content .navbar-nav tl-nav-li:hover {
          border-bottom: none;
          color: inherit;
          background-color: inherit;

          border-bottom: 0.5px solid #e4e4e4;
        }
      }
    }
  }

  .mobile-display.active {
    max-height: var(--tl-mobile-display-max-height);
    transition: max-height 0.5s ease-in-out;
  }

  ::ng-deep {
    tl-button-component {
      --tl-btn-border-radius: 0px;
    }

    .wvr-dropdown .dropdown {
      wvr-button-component {
        width: 100%;

        tl-icon-component.plus-icon {
          display: none;
          float: right;
        }

        tl-icon-component.x-icon {
          display: inline-block;
        }
      }

      [ngbDropdownMenu] {
        padding: 20px 0px;
        border: 1px solid var(--tl-grey);
        border-radius: 3px;
        border-bottom: 12px solid var(--tl-deep-yellow);
        box-shadow: 0px 2px 3px 1px var(--tl-grey);
      }
    }
  }

  @media (max-width: 992px) {
    wvr-dropdown-component {
      ::ng-deep {
        .wvr-dropdown .dropdown {
          .btn {
            text-align: start !important;
          }
        }
      }
    }

    ::ng-deep {
      div[template="dropdown-menu"] {
        display: none;
      }

      .wvr-dropdown .dropdown {
        wvr-button-component {
          tl-icon-component.plus-icon {
            display: inline-block;
          }

          tl-icon-component.x-icon {
            display: none;
          }
        }
      }
    }
  }

}
