/*
 * Controllio · Open source web drafting table for studying control systems
 */

/*
 * View / Style / Main
 */

@import url("navbar.css");
@import url("buttonTooltip.css");
@import url("popupWindow.css");
@import url("element.css");
@import url("elementAnalysisWindow.css");

@import url("https://fonts.googleapis.com/css2?family=Roboto&family=Roboto+Mono&display=swap");

:root {
  /* Colors */
  --color-white-transparent: rgba(255, 255, 255, 0.3);

  --color-blue: rgba(220, 235, 243, 0.7);
  --color-blue-dark: rgba(66, 144, 185, 0.7);
  --color-blue-darker: rgb(93, 126, 211);
  --color-green: rgba(175, 223, 185, 0.7);
  --color-green-darker: rgba(77, 177, 99, 0.9);
  --color-purple: rgba(234, 186, 238, 0.7);
  --color-purple-darker: rgba(196, 96, 196, 0.9);
  --color-red: rgba(230, 189, 173, 0.7);
  --color-red-darker: rgba(199, 134, 106, 0.9);

  --color-grey-80: rgb(80, 80, 80);
  --color-grey-120: rgb(120, 120, 120);
  --color-grey-160: rgb(160, 160, 160);
  --color-grey-170: rgb(170, 170, 170);
  --color-grey-200: rgb(200, 200, 200);
  --color-grey-220: rgb(220, 220, 220);
  --color-grey-230: rgb(230, 230, 230);
  --color-grey-240: rgb(240, 240, 240);
  --color-grey-244: rgb(244, 244, 244);
  --color-grey-248: rgb(248, 248, 248);
  --color-grey-252: rgb(252, 252, 252);

  /* Zooming */
  --zoom-factor: 1;
  --zoomed-1px: calc(1px * var(--zoom-factor));
  --zoomed-2px: calc(2px * var(--zoom-factor));
  --zoomed-12px: calc(12px * var(--zoom-factor));
  --zoomed-24px: calc(24px * var(--zoom-factor));
}

.red {
  color: red;
}

/* Core styles */

html,
body,
.grid {
  height: 100%;
  width: 100%;
  margin: 0;

  /* font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; */
  font-family: "Roboto", sans-serif;
  font-size: 12px;

  overflow: hidden;
}

h1,
h2,
h3 {
  font-size: 12px;
  font-weight: 500;
  margin: 0;
  padding: 0;
}

.grid {
  height: 100%;
  width: 100%;
  background-color: var(--color-grey-252);
  background-image: repeating-linear-gradient(
      var(--color-grey-240) 0 1px,
      transparent 1px 100%
    ),
    repeating-linear-gradient(
      90deg,
      var(--color-grey-240) 0 1px,
      transparent 1px 100%
    );
  background-size: var(--zoomed-24px) var(--zoomed-24px);

  overflow: hidden;
  touch-action: none;
}

.page-overlay {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  /* background-color: rgba(0, 0, 0, 0.1); */
  /* backdrop-filter: blur(1px); */
  z-index: 300;
}

/* Tabs */

.tab-buttons-container {
  flex-grow: 0;
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: left;
  background-color: #fff;
}

.tab-contents {
  width: 100%;
  /* height: 100%; */
  overflow-y: auto;
  overflow-x: hidden;
}

.tab-button {
  height: 35px;
  padding: 0 15px;
  background-color: #fff;
  border: 0;
  font-family: "Roboto", sans-serif;
  cursor: pointer;
}

.tab-button:hover {
  background-color: var(--color-grey-240);
}

.tab-button.active {
  background-color: var(--color-grey-220);
}

.tab-content {
  display: none;
  margin: 15px;
}

.tab-content h3 {
  font-size: 14px;
  font-weight: bold;
}

/* Util */

.hidden {
  display: none;
}

.font-size-smaller {
  font-size: 11px;
}

.flex-row-center {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

.flex-row-left {
  display: flex;
  flex-direction: row;
  justify-content: left;
  align-items: center;
}

.flex-column-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Loading spinner */

.loading-spinner {
  width: 14px;
  height: 14px;
  border: 1px solid var(--color-grey-200);
  border-top-color: #000;
  border-radius: 50%;
  animation: rotate-loading-spinner 1s linear infinite;
}

@keyframes rotate-loading-spinner {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Zoom buttons */

.zoom-buttons-container {
  position: sticky;
  width: fit-content;
  left: 10px;
  bottom: 10px;
  margin: 10px;

  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 150;
}

.zoom-button {
  width: 25px;
  height: 25px;
  background-color: #fff;
  border: 1px solid var(--color-grey-170);
  border-radius: 4px;
}
.zoom-button:hover {
  background-color: var(--color-grey-220);
  cursor: pointer;
}
.zoom-button:disabled {
  background-color: #fff;
  cursor: default;
}

/* JS disabled notification */

.js-disabled-notification {
  background-color: #000;
  color: #fff;
}

.js-disabled-notification h2 {
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 14px;
}
