/* ================================
   Base page + typography
================================ */

html, body {
  background-color: #1F223C;
  color: white;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-weight: 200; /* Normal */
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 100; /* Semi-light for headings */
}

button, .btn {
  font-weight: 200;
}

/* Button press effect */
button:active {
  transform: scale(0.97);
}

/* ================================
   Animations
================================ */

.fade-in {
  animation: fadeIn ease 0.8s;
  opacity: 0;
  animation-fill-mode: forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tab transition animations */
.tab-slide-left {
  animation: slideLeft 1.2s ease-out forwards;
}

.tab-slide-right {
  animation: slideRight 1.2s ease-out forwards;
}

@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ================================
   Layout containers / background
================================ */

/* Main content wrapper (anchors swirl) */
.main-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 20px;
  padding-left: 20px;
  padding-right: 10px;
}

/* Static swirling background */
.swirl-bg {
  position: absolute;
  inset: -50%;
  background: linear-gradient(
    90deg,
    rgba(27, 29, 60, 1) 30%,
    rgba(255,110,199,0.2) 60%,
    rgba(255,110,199,0.3) 70%,
    rgba(255,110,199,0.2) 95%,
    rgba(255,110,199,0.4) 100%
  );
  filter: blur(40px);
  z-index: 0;
}

/* Real page content sits on top */
.page-container {
  border-color: red; /* debug only if needed */
  position: relative;
  z-index: 1;
  flex: 1;
  background-color: inherit;
  overflow: auto;
}

/* Wallpaper background (SVG topo) */
.wallpaper {
  z-index: 0;
  background-color: #1B1D3C;  /* fallback */
  background-image: url("topography.svg");
  background-repeat: repeat;
}

/* Scale container for 1920x1080 layout */
#scale-container {
  transform-origin: top left;
  width: 1920px;
  height: 1080px;
  margin: 0 auto;
  position: relative;
}

/* Generic main-wrapper note – actual flex on parent (layout.py) */
.main-wrapper {
  /* parent flex in layout.py handles placement */
}

/* ================================
   Typography sizing (responsive)
================================ */

h6 {
  font-size: clamp(12px, 1.5vw, 18px);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 1.2em;
}

h1 {
  font-size: clamp(10px, 3.5vw, 32px);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* ================================
   Scrollbars (global)
================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* ================================
   Explainer tiles – fill height
================================ */

.explain-fill > * {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.explain-fill .dash-markdown {
  overflow: auto;
  min-height: 0;
}
