/****************************************************************************
 ** @license
 ** This demo file is part of yFiles for HTML 3.1.0.4.
 ** Copyright (c) 2026 by yWorks GmbH, Vor dem Kreuzberg 28,
 ** 72070 Tuebingen, Germany. All rights reserved.
 **
 ** yFiles demo files exhibit yFiles for HTML functionalities. Any redistribution
 ** of demo files in source code or binary form, with or without
 ** modification, is not permitted.
 **
 ** Owners of a valid software license for a yFiles for HTML version that this
 ** demo is shipped with are allowed to use the demo source code as basis
 ** for their own yFiles for HTML powered applications. Use of such programs is
 ** governed by the rights and conditions as set out in the yFiles for HTML
 ** license agreement.
 **
 ** THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED
 ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
 ** NO EVENT SHALL yWorks BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 ** TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 ** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 ** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 **
 ***************************************************************************/
:root {
  --orange: #ff6c00;
  --orange-60: #f89743;
  --orange-20: #fcdabe;
  --orange-dark: #510518;

  --blue: #242265;
  --blue-60: #666495;
  --blue-20: #c8c8d9;
  --blue-dark: #0c0c23;

  --cyan: #4ad8ff;
  --cyan-60: #85ebff;
  --cyan-20: #e8fcff;
  --cyan-dark: #1c4355;

  --green: #c5fb00;
  --green-60: #dffd79;
  --green-20: #faffe8;
  --green-dark: #27401b;

  --purple: #b786ff;
  --purple-60: #d8bcff;
  --purple-20: #f8f3ff;
  --purple-dark: #413148;

  --neutral-gray: #4e4e4e;
}

/* Color Grid Styles */
#color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.color-cube {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Viewport Rectangle in Overview */
.yfiles-overview-viewport-template {
  fill: var(--purple-60);
  stroke: var(--purple);
  stroke-width: 2px;
}
#overview-component .yfiles-handle {
  color: var(--purple);
}

/* Resize Handles */
.yfiles-handle-template.yfiles-handle-resize-template {
  fill: currentColor; /* Use SVG currentColor to allow different colors for individual handles*/
  stroke: currentColor; /* Use SVG currentColor to allow different colors for individual handles*/
}

.yfiles-handle {
  color: var(--cyan-60);
  &.yfiles-handle-top.yfiles-handle-right,
  &.yfiles-handle-top.yfiles-handle-left,
  &.yfiles-handle-bottom.yfiles-handle-right,
  &.yfiles-handle-bottom.yfiles-handle-left {
    color: var(--purple);
  }
}

/* Port Handle */
.yfiles-handle-move-template {
  fill: var(--orange);
}

/* Marquee Selection Rectangle */
.yfiles-marquee-rect-template {
  fill: var(--cyan-20);
  stroke: var(--cyan-60);
  stroke-width: 2px;
}

/* Selection */
.yfiles-selection-template {
  &.yfiles-node-selection-template,
  &.yfiles-edge-selection-template,
  &.yfiles-label-selection-template,
  &.yfiles-port-selection-template {
    stroke: var(--cyan-60);
    stroke-width: 4px;
    stroke-linejoin: round;
  }
}

/* Focus */
.yfiles-focus-template {
  &.yfiles-node-focus-template,
  &.yfiles-edge-focus-template,
  &.yfiles-label-focus-template,
  &.yfiles-port-focus-template {
    stroke: var(--purple);
    stroke-width: 2px;
    stroke-linejoin: round;
  }
}

/* Highlights */
.yfiles-highlight-template {
  &.yfiles-edge-highlight-template,
  &.yfiles-node-highlight-template,
  &.yfiles-label-highlight-template,
  &.yfiles-port-highlight-template {
    stroke: var(--cyan);
    stroke-linejoin: round;
  }
}

/* Label Candidates */
.yfiles-label-position-highlight-template {
  stroke: var(--orange-60);
}
.yfiles-label-position-candidate-template {
  stroke: var(--orange-60);
}

/* Port Candidates */
.yfiles-port-candidate-template.yfiles-valid {
  fill: var(--green);
}

/* Snap References */
.yfiles-snap-reference {
  stroke: var(--purple-60);
  stroke-width: 2px;
}

/* Scrollbars */
.yfiles-canvascomponent {
  --yfiles-scrollbar-vertical-size: 10px;
  --yfiles-scrollbar-horizontal-size: 10px;
}

.yfiles-scrollbar {
  .yfiles-scrollbar-vertical .yfiles-scrollbar-slider {
    width: 8px;
  }
  .yfiles-scrollbar-horizontal .yfiles-scrollbar-slider {
    height: 8px;
  }
  .yfiles-scrollbar-slider {
    background-color: var(--blue);
  }
  .yfiles-button {
    flex-basis: 10px;
    background-size: contain;
  }
  .yfiles-button.yfiles-button-left {
    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNSIgaGVpZ2h0PSIxMCI+PHBhdGggZD0iTTUgNSBMMTAgMSBMMTAgOSBaIi8+PC9zdmc+DQo=);
  }
  .yfiles-button.yfiles-button-right {
    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNSIgaGVpZ2h0PSIxMCI+PHBhdGggZD0iTTUgMSBMMTAgNSBMNSA5IFoiLz48L3N2Zz4NCg==);
  }
  .yfiles-button.yfiles-button-down {
    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxNSI+PHBhdGggZD0iTTEgNSBMOSA1IEw1IDEwIFoiLz48L3N2Zz4NCg==);
  }
  .yfiles-button.yfiles-button-up {
    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxNSI+PHBhdGggZD0iTTEgMTAgTDUgNSBMOSAxMCBaIi8+PC9zdmc+DQo=);
  }
}

/* Tooltips */
.yfiles-tooltip {
  background-color: var(--orange-20);
  color: var(--orange-dark);
  border-color: var(--orange-dark);
  border-radius: 5px;
  border-width: 2px;
  padding: 5px;
  font-weight: bold;
}
.yfiles-popover--tooltip[popover] {
  transition:
    transform 200ms ease,
    display 200ms allow-discrete;
  transform: scale(0);
  &:popover-open {
    transform: scale(1);
    @starting-style {
      & {
        transform: scale(0);
      }
    }
  }
}

/* Label Editor*/
@keyframes fade-animation {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.yfiles-labeleditbox-container {
  background-color: var(--purple-20);
  border-color: var(--purple-dark);
  border-radius: 5px;
  padding: 3px 5px;
}

.yfiles-labeleditbox {
  font-family: sans-serif;
  font-size: 12pt;
  color: var(--purple-dark);
}

.yfiles-labeleditbox::selection {
  background: var(--cyan);
  color: var(--purple-dark);
}

.yfiles-labeleditbox-container-entering {
  animation: fade-animation 0.3s ease-in;
}
.yfiles-labeleditbox-container-leaving {
  animation: fade-animation reverse 0.3s ease-out;
}

.node-style {
  transition: opacity 1s ease-in;
  &.hidden {
    opacity: 0;
  }
}
