/* ══════════════════════════════════════════
   FONT ALIASES
   Playfair Display → editorial headlines
   DM Sans          → UI body copy
══════════════════════════════════════════ */
:root {
  --font-display: 'Playfair Display', Georgia, serif;
  --font-ui:      'DM Sans', system-ui, sans-serif;
}

/* ══════════════════════════════════════════
   DESIGN TOKENS — DARK (default)
══════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg:        #080810;
  --surface:   #0d0d1a;
  --panel:     #12121f;
  --card:      #16162a;

  /* Borders */
  --border:    rgba(255, 255, 255, 0.07);
  --border-md: rgba(255, 255, 255, 0.12);

  /* Brand accents */
  --gold:      #e8b84b;
  --gold-dim:  rgba(232, 184, 75, 0.1);
  --gold-glow: rgba(232, 184, 75, 0.25);
  --red:       #e03030;
  --red-dim:   rgba(224, 48, 48, 0.12);
  --purple:    #8b5cf6;
  --teal:      #2dd4bf;
  --pink:      #ec4899;

  /* Text */
  --text:      #f0eef8;
  --text-2:    #b8b6cc;
  --muted:     #5a5870;

  /* Utility */
  --shadow:    rgba(0, 0, 0, 0.5);
  --shadow-sm: rgba(0, 0, 0, 0.25);

  /* Layout */
  --sidebar-w: 260px;
  --topbar-h:  68px;
  --bottom-h:  64px;
  --r:         14px;
  --r-sm:      9px;
  --r-xs:      6px;
}

/* ══════════════════════════════════════════
   DESIGN TOKENS — LIGHT
══════════════════════════════════════════ */
[data-theme="light"] {
  --bg:        #f4f4f8;
  --surface:   #ffffff;
  --panel:     #f0f0f6;
  --card:      #ffffff;
  --border:    rgba(0, 0, 0, 0.07);
  --border-md: rgba(0, 0, 0, 0.14);
  --gold:      #b8860b;
  --gold-dim:  rgba(184, 134, 11, 0.08);
  --gold-glow: rgba(184, 134, 11, 0.2);
  --red:       #c0392b;
  --red-dim:   rgba(192, 57, 43, 0.08);
  --purple:    #6d28d9;
  --teal:      #0d9488;
  --pink:      #db2777;
  --text:      #0f0f1a;
  --text-2:    #3d3d55;
  --muted:     #7c7a94;
  --shadow:    rgba(0, 0, 0, 0.1);
  --shadow-sm: rgba(0, 0, 0, 0.05);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: clamp(15px, 1.1vw + 12px, 17px);
  line-height: 1.55;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* No transition on initial load — only add it after first paint */
}

/* ══════════════════════════════════════════
   UTILS
══════════════════════════════════════════ */

/* Spectrum gradient text — used on "Awards" word */
.spectrum-text {
  background: linear-gradient(100deg, #ff6b6b 0%, #ffd93d 30%, #6bcb77 55%, #4d96ff 80%, #c77dff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Red brand text — matches logo */
.brand-text {
  color: var(--red);
  font-family: var(--font-display);
  font-weight: 800;
}

.hidden { display: none !important; }

/* ══════════════════════════════════════════
   NOISE OVERLAY (dark only — adds texture)
══════════════════════════════════════════ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 1;
  transition: opacity .3s;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

[data-theme="light"] body::after { opacity: 0; }

/* ══════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  transition: background .3s, border-color .3s;
}

/* Spectrum colour bar at top — REMOVED per design update */
.sidebar::before {
  display: none;
}

/* ── LOGO AREA ── */
.sidebar-logo {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo-img {
  width: 103px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(224, 48, 48, .4));
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-logo-awards {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.4vw, 54px);
  font-weight: 800;
  font-style: italic;
  background: linear-gradient(100deg, #e03030 0%, #e8b84b 40%, #e03030 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
  will-change: background-position;
}

.sidebar-logo-year {
  font-family: var(--font-ui);
  font-size: clamp(10px, 0.7vw, 11px);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

@keyframes shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ── NAV ── */
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-family: var(--font-ui);
  /* font-size: clamp(13px, 1vw, 14px); */
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .18s ease;
  position: relative;
  letter-spacing: .1px;
}

.nav-item:hover {
  color: var(--text);
  background: var(--panel);
}

.nav-item.active {
  color: var(--gold);
  background: var(--gold-dim);
  border-color: var(--gold-glow);
  font-weight: 600;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  right: -1px; top: 20%; bottom: 20%;
  width: 2px;
  background: var(--gold);
  border-radius: 2px 0 0 2px;
}

.nav-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  font-size: 28px;   /* emoji icons */
}

/* SVGs inside nav-icon scale to fill the container */
.nav-icon svg,
.nav-icon .svg {
  width: 44px;
  height: 44px;
  display: block;
  flex-shrink: 0;
}

.nav-label { flex: 1; }

/* ── FOOTER ── */
.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color .18s, background .18s;
}

.user-pill:hover {
  border-color: var(--gold-glow);
  background: var(--card);
}

.u-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), #8b1a1a);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: .5px;
}

.u-info { min-width: 0; }
.u-name { font-size: clamp(12px, 0.9vw, 13px); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-role { font-size: clamp(10px, 0.75vw, 11px); color: var(--muted); }

/* ══════════════════════════════════════════
   THEME TOGGLE BUTTON
══════════════════════════════════════════ */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
  transition: border-color .18s, transform .25s;
  flex-shrink: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  border-color: var(--gold);
  transform: rotate(22deg) scale(1.05);
}

/* ══════════════════════════════════════════
   MOBILE
══════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body {
    overflow: auto;
    height: auto;
    min-height: 100%;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar { display: none; }
}
