/* ===================== SITE-WIDE (HEADER + FOOTER) ===================== */
* { box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background-color: #1b1324;
  color: #ffffff;
  display: flex;
  flex-direction: column;
}

:root{ color-scheme: dark; }

main{ flex: 1; }

a{ color: inherit; text-decoration: none; }
a:hover{ opacity: 0.85; }

button{
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
}

/* Buttons (same as your app look) */
:where(button, .btn){
  border-radius: 12px;
  transition:
    transform .15s ease,
    background .15s ease,
    border-color .15s ease,
    box-shadow .15s ease,
    filter .15s ease,
    opacity .15s ease;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
  box-shadow: 0 10px 22px rgba(0,0,0,0.22);
}

.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 14px 30px rgba(0,0,0,0.26);
}

.btn:active{
  transform: translateY(0px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

.btn:focus-visible{
  outline: 2px solid rgba(255, 90, 60, 0.9);
  outline-offset: 3px;
}

.btn.primary{
  background: linear-gradient(180deg, rgba(255,90,60,1), rgba(255,90,60,0.85));
  border: 1px solid rgba(255,90,60,0.55);
  color: #ffffff;
  box-shadow:
    0 14px 30px rgba(255,90,60,0.20),
    0 10px 20px rgba(0,0,0,0.22);
}

.btn.primary:hover{
  filter: brightness(1.03);
  box-shadow:
    0 18px 40px rgba(255,90,60,0.25),
    0 12px 26px rgba(0,0,0,0.24);
}




/* ===================== HEADER NAV ===================== */
.header-nav{
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content: center;

  padding: 0;                 /* ✅ remove outer padding */
  border-radius: 0;           /* ✅ no big capsule */
  background: transparent;    /* ✅ remove outer background */
  border: 0;                  /* ✅ remove outer border */
  box-shadow: none;           /* ✅ remove outer shadow */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;

  flex-wrap: wrap;
}

.header-nav a{
  padding: 10px 14px;
  border-radius: 999px;

  font-weight: 850;
  color: rgba(255,255,255,0.78);

  border: 1px solid transparent;
  text-decoration: none;

  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}

.header-nav a:hover{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.95);
  transform: translateY(-1px);
}

.header-nav a.active{
  color: #ff5a3c;                 /* ✅ orange text */
  background: rgba(255, 90, 60, 0.16);
  border-color: rgba(255, 90, 60, 0.35);
  box-shadow: 0 10px 22px rgba(0,0,0,0.18);
  border-radius: 999px;           /* ✅ guarantee round */
}

/* Wrap nicely on small screens */
@media (max-width: 900px){
  .header-nav{
    flex-wrap: wrap;
    border-radius: 18px;
    gap: 10px;
  }
}

/* Optional: if any nav link accidentally has .btn styling */
.header-nav a.btn{
  background: none !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}
.header-nav a.btn.active{
  background: rgba(255, 90, 60, 0.20) !important;
  border-color: rgba(255, 90, 60, 0.35) !important;
  box-shadow: 0 10px 22px rgba(0,0,0,0.18) !important;
}

/* ===================== OPTIONAL: "Refer a Friend" highlight ring ===================== */
.header-nav a.is-highlight{
  position: relative;
  isolation: isolate;
}

.header-nav a.is-highlight::after{
  content:"";
  position:absolute;
  inset:-6px;
  border-radius: 999px;
  border: 2px solid rgba(255, 90, 60, 0.55);
  box-shadow: 0 0 0 0 rgba(255, 90, 60, 0.35);
  opacity: 0.9;
  z-index: -1;
  animation: navPulse 1.6s ease-out infinite;
  pointer-events:none;
}

@keyframes navPulse{
  0%   { transform: scale(1);    opacity: 0.85; box-shadow: 0 0 0 0 rgba(255, 90, 60, 0.35); }
  70%  { transform: scale(1.08); opacity: 0;    box-shadow: 0 0 0 14px rgba(255, 90, 60, 0); }
  100% { transform: scale(1.08); opacity: 0;    box-shadow: 0 0 0 14px rgba(255, 90, 60, 0); }
}

@media (prefers-reduced-motion: reduce){
  .header-nav a.is-highlight::after{ animation: none; }
}

/* ===================== BRAND (LOGO + TEXT) ===================== */
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:inherit;
  min-width: 0;
}

.brand-logo{
  width:40px;
  height:40px;
  border-radius:12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  flex: 0 0 auto;
}

.brand-text{
  display:flex;
  flex-direction:column;
  line-height:1.05;
  min-width:0;
}

.brand-name{
  font-size:20px;
  font-weight:900;
  white-space:nowrap;
}

.brand-accent{
  color:#ff5a3c; /* match your existing accent */
}

.brand-tagline{
  font-size:12px;
  opacity:.7;
  white-space:nowrap;
}

@media (max-width: 600px){
  .brand-tagline{ display:none; }
  .brand-logo{ width:34px; height:34px; }
}


/* ---------------- HEADER (same structure on ALL pages) ---------------- */
.app-header{
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #1b1324;
  border-bottom: 1px solid #2c1f38;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-left{
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  flex: 1;                   
}
.header-nav{
  margin: 0 auto;             /* ✅ centers nav group inside header-left */
}


.header-right{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ------------------------------
   Notifications bell (top nav)
------------------------------ */
.notif-btn{
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.notif-btn:hover{
  background: rgba(255,255,255,0.08);
}

.notif-icon{
  width: 18px;
  height: 18px;
  fill: rgba(255,255,255,0.92);
}

.notif-badge{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  background: #ff5a3c;
  color: #fff;
  border: 2px solid rgba(27,19,36,0.95);
}

/* ------------------------------
   Notifications popover (preview)
------------------------------ */
.notif-popover{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  max-width: 86vw;
  background: rgba(27,19,36,0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  padding: 12px;
  z-index: 2000;
}

/* Make sure the popover positions under the bell */
.header-right{
  position: relative;
}

.notif-popover-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 10px;
}

.notif-popover-title{
  font-weight: 900;
  font-size: 14px;
  color: rgba(255,255,255,0.92);
}

.notif-popover-link{
  font-weight: 800;
  font-size: 12px;
  color: rgba(255,255,255,0.78);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}

.notif-popover-link:hover{
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
}

.notif-preview-title{
  font-weight: 900;
  font-size: 14px;
  margin-bottom: 6px;
}

.notif-preview-body{
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.85;
  max-height: 56px;          /* ~3-4 lines */
  overflow: hidden;
}

.notif-preview-date{
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.65;
}


/* “signed out” pill */
.header-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.90);
  font-weight: 900;
  font-size: 13px;
}

/* Rank pill (for app pages only, but safe globally) */
.rank-pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  font-weight: 900;
  font-size: 13px;
  color: rgba(255,255,255,0.92);
}

.rank-icon-top{
  font-size: 15px;
  line-height: 1;
}

/* Hide nav on mobile (matches your behavior) */
@media (max-width: 900px){
  .header-nav{ display:flex; flex-wrap:wrap; gap:10px; }
}

/* ---------------- FOOTER (same on ALL pages) ---------------- */
footer{
  background: #1b1324;
  border-top: 1px solid #2c1f38;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-right{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ===== FINAL: force active nav text to orange everywhere ===== */
.app-header .header-nav a.active,
.app-header .header-nav a[aria-current="page"]{
  color: #ff5a3c !important;   /* orange text */
}

/* keep the pill look consistent too */
.app-header .header-nav a.active{
  border-radius: 999px !important;
}
/* ===== Center nav in header (CSS-only) ===== */
.app-header{ position: relative; }

@media (min-width: 901px){
  .app-header .header-nav{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}
/* Rotating CTA text in nav (FIXED sizing) */
.nav-rotating{
  position: relative;
  display: inline-flex;          /* ensure it behaves like the other links */
  align-items: center;
  justify-content: center;
  min-height: 1em;               /* keeps height consistent */
}

/* BOTH spans sit on top of each other, but the link keeps width/height */
.nav-rotating .nav-text{
  grid-area: 1 / 1;
  white-space: nowrap;
}

/* Use grid overlay so both spans overlap without collapsing layout */
.nav-rotating{
  display: inline-grid;
  place-items: center;
}

/* Primary visible first */
.nav-rotating .nav-text-primary{
  opacity: 1;
  animation: navSwapPrimary 6s infinite;
}

/* Alt fades in later */
.nav-rotating .nav-text-alt{
  opacity: 0;
  animation: navSwapAlt 6s infinite;
}

@keyframes navSwapPrimary{
  0%, 45%   { opacity: 1; }
  50%, 95%  { opacity: 0; }
  100%      { opacity: 1; }
}

@keyframes navSwapAlt{
  0%, 45%   { opacity: 0; }
  50%, 95%  { opacity: 1; }
  100%      { opacity: 0; }
}
/* ===================== MOBILE LAYOUT FIXES ===================== */
/* Paste at very bottom of site.css */

@media (max-width: 900px){

  /* Header: stop fighting itself on mobile */
  .app-header{
    position: sticky;
    top: 0;
    padding: 12px 12px;
    gap: 10px;
    flex-wrap: wrap;          /* ✅ allows rows */
    align-items: center;
  }

  /* Make the left/right behave like rows */
  .header-left{
    flex: 1 1 100%;
    min-width: 0;
    justify-content: space-between;
    gap: 10px;
  }

  .header-right{
    flex: 1 1 100%;
    justify-content: space-between; /* buttons spread nicer */
    gap: 10px;
  }

  /* Nav becomes its own row and centers */
  .header-nav{
    flex: 1 1 100%;
    justify-content: center;
    margin: 0;                /* ✅ undo desktop centering tricks */
  }

  /* Make nav pills fit better */
  .header-nav a{
    padding: 9px 12px;
    font-size: 13px;
  }

  /* Brand text won’t overflow */
  .brand-name{
    font-size: 18px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* If you have “panels” that are too wide on mobile */
@media (max-width: 700px){
  .panel{
    width: 100%;
    max-width: 100%;
  }

  /* Prevent horizontal scrolling from long content */
  body, main{
    overflow-x: hidden;
  }
}
