/* PolyRay Dashboard — Shared Styles */

/* ── Global scrollbars ────────────────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(4,121,127,0.45) rgba(1,9,13,0.4);
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(1,9,13,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(4,121,127,0.45); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(2,179,183,0.7); }
::-webkit-scrollbar-corner { background: transparent; }

/* Native cross-page transitions (Chromium 126+) */
@view-transition {
  navigation: auto;
}

.topnav {
  view-transition-name: topnav;
}

.dashboard-grid,
.page-content {
  view-transition-name: main-content;
}

::view-transition-old(main-content) {
  animation: contentOut 0.15s ease forwards;
}

::view-transition-new(main-content) {
  animation: contentIn 0.35s ease-out forwards;
}

@keyframes contentOut {
  to { opacity: 0; }
}

@keyframes contentIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

::view-transition-old(topnav),
::view-transition-new(topnav) {
  animation: none;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --dark-teal:  #04797F;
  --mid-teal:   #02B3B7;
  --bright-teal:#07DAE5;
  --lime:       #ABDC69;
  --cream:      #EEF3CF;
  --red:        #F64C60;
  --base-bg:    #01090D;
  --card-bg:    rgba(0,0,0,0.2);
  --card-header-bg: rgba(0,0,0,0.3);
  --card-border:#04797F;
}

html {
  background: #01090D;
}

html, body {
  height: 100%;
  font-family: 'IBM Plex Mono', monospace;
  background: var(--base-bg);
  color: var(--cream);
  min-width: 900px;
  overflow-x: auto;
}


/* Background gradient layer */
#bg-gradient {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(
    ellipse 856px 558.5px at 701px 366.5px,
    rgba(4,121,127,0.4) 0%,
    rgba(13,17,43,0) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* All page content sits above gradient */
nav, .dashboard-grid, .page-content {
  position: relative;
  z-index: 1;
}

/* ── Top Navigation ──────────────────────────────────────────────── */
.topnav {
  width: 100%;
  height: 56px;
  background: linear-gradient(90deg, #000000 0%, #021218 100%);
  border-bottom: 1px solid #04797F;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-subtitle-text {
  font-size: 16px;
  font-weight: 500;
  color: #04797F;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 12px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.nav-btn {
  display: inline-block;
  padding: 7px 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(2,179,183,0.65);
  background: transparent;
  border: 1px solid #04797F;
  border-radius: 8px;
  transition: all 0.15s;
  cursor: pointer;
}

.nav-btn:hover {
  background: rgba(2,179,183,0.08);
  color: #02B3B7;
  border-color: #02B3B7;
}

.nav-btn.active {
  background: #04797F;
  border-color: #04797F;
  color: #ffffff;
}

/* ── Dropdown nav item ───────────────────────────────────────────── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 160px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(4,121,127,0.45);
  border-radius: 10px;
  overflow: hidden;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  padding-top: 6px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 9px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(2,179,183,0.65);
  border-bottom: 1px solid rgba(4,121,127,0.2);
  transition: all 0.12s;
  position: relative;
  z-index: 1;
}

.nav-dropdown-menu a:first-child { border-radius: 10px 10px 0 0; }
.nav-dropdown-menu a:last-child  { border-bottom: none; border-radius: 0 0 10px 10px; }
.nav-dropdown-menu a:only-child  { border-radius: 10px; }

.nav-dropdown-menu a:hover {
  background: rgba(2,179,183,0.08);
  color: #02B3B7;
}

.nav-dropdown-menu a.active {
  background: rgba(4,121,127,0.2);
  color: #ffffff;
}

.nav-btn.dropdown-trigger::after {
  content: ' ▾';
  font-size: 9px;
  opacity: 0.6;
}

/* ── Tile (card) ─────────────────────────────────────────────────── */
.tile {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
}

.tile-header {
  background: var(--card-header-bg);
  border-bottom: 1px solid var(--card-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.tile-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--bright-teal);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.tile-body {
  padding: 16px;
}

/* ── Utility ─────────────────────────────────────────────────────── */
.text-lime   { color: var(--lime); }
.text-red    { color: var(--red); }
.text-cream  { color: var(--cream); }
.text-teal   { color: var(--mid-teal); }

/* ── Toggle buttons (used on dashboard and calculator) ───────────── */
.toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 16px;
}
.toggle-btn {
  padding: 8px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid #04797F;
  background: rgba(4,121,127,0.15);
  color: #02B3B7;
  transition: all 0.15s;
}
.toggle-btn:first-child { border-radius: 6px 0 0 6px; border-right: none; }
.toggle-btn:last-child  { border-radius: 0 6px 6px 0; }
.toggle-btn.active { background: #04797F; color: #ffffff; }
.toggle-btn:hover  { background: rgba(2,179,183,0.08); color: #02B3B7; }
.toggle-btn.active:hover { background: #04797F; color: #ffffff; }
