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

/* Root variables */
:root {
  --border-col: #ccc;
  --border-col-soft: #ddd;
  --bg-col: #f9f9f9;
  --bg-col-transparent: #f9f9f999;
  --secondary-header-col: #555;
  --text-col: #333;
  --text-col-soft: #555;
}

/* === DARK MODE === */
html.dark-mode {
  --border-col: #444;
  --border-col-soft: #444a;
  --bg-col: #181920;
  --bg-col-transparent: #181920cc;
  --secondary-header-col: #ddd;
  --text-col: #eee;
  --text-col-soft: #bbb;
}

html,
body {
  background: var(--bg-col);
  padding: 0;
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  color: var(--text-col);
  line-height: 1.5;
}

body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

main {
  display: flex;
  flex-grow: 1;
  box-sizing: border-box;
  overflow: auto;
  height: auto;
}

/* Components */

svg {
  width: 32px;
  height: 32px;
}

svg.theme-stroke {
  stroke: var(--text-col);
}

svg.theme-fill {
  fill: var(--text-col);
}

button {
  background: var(--bg-col);
  border: 1px solid var(--border-col);
  box-sizing: border-box;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-col);
  font-size: 1rem;
}

button:hover {
  background: var(--border-col-soft);
}

button:active {
  background: var(--border-col);
}

button:disabled {
  background: var(--border-col-soft);
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-col);
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
  color: var(--text-col);
  background: var(--bg-col);
}

/* Sidebar */
.sidebar {
  width: 280px;
  height: 100%;
  box-sizing: border-box;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 100;
  transition: margin-left 0.2s ease-in-out;
}

.sidebar.collapsed {
  margin-left: -280px;
}

.sidebar-always-visible {
  margin-left: 0;
  transition: margin-left 0.2s ease-in-out;
}

.sidebar.collapsed .sidebar-always-visible {
  margin-left: 280px;
}

.sidebar.bordered {
  border: none;
  border-right: 1px solid var(--border-col-soft);
}

.sidebar.solid {
  background: var(--bg-col);
}

/* Header */
header {
  display: flex;
  padding: 10px;
}

header.sticky {
  position: sticky;
  top: 0;
  z-index: 100;
}

header.solid {
  background: var(--bg-col);
}

header.bordered {
  border: none;
  border-bottom: 1px solid var(--border-col);
}

/* Panel */
.panel {
  border: 1px solid var(--border-col);
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-col);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

/*Popups*/
.fullscreen-popup-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-col-transparent);
  backdrop-filter: blur(3px);
  display: flex;
  z-index: 999;
}

.fullscreen-popup-overlay:not(.show) {
  display: none;
}

/*Tooltip*/
[data-tooltip-warning] {
  position: relative;
}

[data-tooltip-warning]::after {
  position: absolute;
  content: attr(data-tooltip-warning);
  background: var(--bg-col);
  border: 1px solid var(--border-col);
  border-radius: 8px;
  padding: 8px;
  text-align: left;
  width: fit-content;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  display: none;
  transition: opacity 0.2s ease-in-out;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  color: #a44;
}

.tooltip-goright[data-tooltip-warning]::after {
  right: 0;
  left: auto;
}

[data-tooltip-warning]:hover::after {
  opacity: 1;
  display: block;
}

/* Mobile navigation */
.mobile-nav {
  display: none;
  flex-direction: row;
  justify-content: space-between;
  background: linear-gradient(to top, var(--bg-col), transparent);
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
}

.mobile-nav.bordered {
  border: none;
  border-top: 1px solid var(--border-col);
  background: var(--bg-col);
}

/* Headings */
h3,
h4,
h5,
h6 {
  color: var(--secondary-header-col);
  font-size: 1rem;
  font-weight: 400;
}

h3 {
  text-transform: uppercase;
  font-weight: 800;
}

/* Utility Classes */
.bordered {
  border: 1px solid var(--border-col);
}

.fr {
  display: flex;
  flex-direction: row;
}

.fc {
  display: flex;
  flex-direction: column;
}

.fullwidth {
  width: 100%;
}

.gap10 {
  gap: 10px;
}

.fullheight {
  height: 100%;
}

.center-x {
  display: flex;
  justify-content: center;
}

.center-y {
  display: flex;
  align-items: center;
}

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

.inherit-structure {
  display: flex;
  flex-direction: inherit;
  justify-content: inherit;
  align-items: inherit;
  gap: inherit;
  flex-wrap: inherit;
  flex-grow: inherit;
  flex-basis: inherit;
  flex-shrink: inherit;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  main {
    flex-direction: column;
  }

  .mobile-nav {
    display: flex;
  }

  .sidebar {
    width: 100%;
  }

  .sidebar:not(.mobile-popup),
  .sidebar.mobile-popup:not(.active) {
    display: none;
  }
}