/* Site shell: fixed left nav + main column (loaded from base.html) */

:root {
  --app-scrollbar-size: 10px;
  --app-scrollbar-track-color: rgba(255, 255, 255, 0.035);
  --app-scrollbar-track-gloss: rgba(255, 255, 255, 0.015);
  --app-scrollbar-thumb-color: rgba(139, 124, 248, 0.48);
  --app-scrollbar-thumb-start: rgba(139, 124, 248, 0.54);
  --app-scrollbar-thumb-end: rgba(93, 228, 244, 0.38);
  --app-scrollbar-thumb-hover-color: rgba(93, 228, 244, 0.62);
  --app-scrollbar-thumb-hover-start: rgba(139, 124, 248, 0.68);
  --app-scrollbar-thumb-hover-end: rgba(93, 228, 244, 0.56);
  --app-scrollbar-thumb-active-color: rgba(93, 228, 244, 0.76);
  --app-scrollbar-thumb-active-start: rgba(139, 124, 248, 0.82);
  --app-scrollbar-thumb-active-end: rgba(93, 228, 244, 0.68);
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--app-scrollbar-thumb-color) var(--app-scrollbar-track-color);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--app-scrollbar-thumb-color) var(--app-scrollbar-track-color);
}

*::-webkit-scrollbar {
  width: var(--app-scrollbar-size);
  height: var(--app-scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: linear-gradient(180deg, var(--app-scrollbar-track-color), var(--app-scrollbar-track-gloss));
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  min-height: 32px;
  min-width: 32px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--app-scrollbar-thumb-start), var(--app-scrollbar-thumb-end));
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--app-scrollbar-thumb-hover-start), var(--app-scrollbar-thumb-hover-end));
}

*::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, var(--app-scrollbar-thumb-active-start), var(--app-scrollbar-thumb-active-end));
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

.site-sidebar {
  position: fixed;
  z-index: 200;
  left: 0;
  top: 0;
  width: 20%;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 32px;
  background: #0b0c19;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.25);
}

.site-sidebar__inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.site-sidebar__brand {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  background: linear-gradient(110deg, #8b7cf8 15%, #5de4f4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
}

.site-sidebar__brand:hover {
  filter: brightness(1.08);
}

.site-sidebar__kicker {
  margin: 0;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
}

.site-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-sidebar__link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.73rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.site-sidebar__link:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.site-sidebar__link.is-active {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(139, 124, 248, 0.12);
  border-color: rgba(139, 124, 248, 0.28);
}

.site-main {
  margin-left: 20%;
  width: 80%;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.site-main__inner {
  flex: 1 0 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-footer {
  padding: 0 24px 28px;
}

.fynn-footer {
  margin-top: auto;
  background: transparent;
}

.fynn-footer__inner {
  width: 100%;
  max-width: calc(var(--content, 600px) + 32px);
  margin: 0 auto;
  padding-top: 20px;
  text-align: center;
}

.fynn-footer__links {
  display: flex;
  justify-content: center;
  gap: 18px 24px;
  flex-wrap: wrap;
}

.fynn-footer__links a,
.fynn-footer__support,
.fynn-footer__support a {
  color: var(--t60, rgba(255, 255, 255, 0.55));
  font-family: var(--mono, "Space Mono", ui-monospace, monospace);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.2s ease;
}

.fynn-footer__links a:hover,
.fynn-footer__support a:hover {
  color: var(--t100, rgba(255, 255, 255, 0.9));
}

.fynn-footer__support {
  margin-top: 12px;
}

/* ── Sidebar auth: guest login button ─────────────────────────── */

.sidebar-auth-btn {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(139, 124, 248, 0.28);
  background: rgba(139, 124, 248, 0.08);
  color: rgba(255, 255, 255, 0.80);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.73rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sidebar-auth-btn:hover {
  background: rgba(139, 124, 248, 0.16);
  border-color: rgba(139, 124, 248, 0.45);
  color: rgba(255, 255, 255, 0.95);
}

/* ── Sidebar auth: authenticated user card ────────────────────── */

.sidebar-user {
  position: relative;
}

.sidebar-user__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.73rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  appearance: none;
  outline: none;
}

.sidebar-user__trigger:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
}

.sidebar-user__avatar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b7cf8 0%, #5de4f4 100%);
  color: #06070e;
  font-family: "Unbounded", sans-serif;
  font-size: 0.60rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-user__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user__chevron {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  opacity: 0.45;
  transition: opacity 0.15s, transform 0.2s;
}

.sidebar-user__trigger[aria-expanded="true"] .sidebar-user__chevron {
  transform: rotate(90deg);
  opacity: 0.75;
}

/* Dropdown opens to the RIGHT to avoid pushing nav content down */
.sidebar-user__dropdown {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  z-index: 300;
  min-width: 160px;
  padding: 5px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: #111223;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.sidebar-user__item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  appearance: none;
  outline: none;
}

.sidebar-user__item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
}

.sidebar-user__item--danger:hover {
  background: rgba(240, 138, 171, 0.10);
  color: rgba(240, 138, 171, 0.90);
}

.sidebar-user__logout-form {
  margin: 0;
  padding: 0;
}

/* ── Language switcher ────────────────────────────────────── */

.lang-menu {
  position: relative;
}

.lang-form {
  margin: 0;
  padding: 0;
}

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(139, 124, 248, 0.18);
  background: rgba(139, 124, 248, 0.06);
  color: rgba(255, 255, 255, 0.65);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  appearance: none;
  outline: none;
}

.lang-trigger:hover {
  background: rgba(139, 124, 248, 0.12);
  border-color: rgba(139, 124, 248, 0.35);
  color: rgba(255, 255, 255, 0.92);
}

.lang-trigger[aria-expanded="true"] {
  background: rgba(139, 124, 248, 0.12);
  border-color: rgba(139, 124, 248, 0.35);
  color: rgba(255, 255, 255, 0.88);
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.lang-flag {
  font-size: 0.95rem;
  line-height: 1;
}

.lang-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-caret {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  opacity: 0.40;
  transition: opacity 0.15s, transform 0.2s;
}

.lang-trigger[aria-expanded="true"] .lang-caret {
  transform: rotate(180deg);
  opacity: 0.70;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 300;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: #111223;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  appearance: none;
  outline: none;
  white-space: nowrap;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
}

.lang-option.is-selected {
  color: rgba(139, 124, 248, 0.92);
  background: rgba(139, 124, 248, 0.10);
}

.lang-option.is-selected:hover {
  background: rgba(139, 124, 248, 0.16);
  color: rgba(139, 124, 248, 1);
}

.lang-name {
  flex: 1 1 auto;
}

@media (max-width: 640px) {
  .site-footer {
    padding: 0 16px 24px;
  }

  .fynn-footer__inner {
    padding-top: 16px;
  }
}
