﻿/* ===== RESET ===== */
body, h1, h2, p {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Roboto, sans-serif;
  background: #f9fafb;
  color: #222;
}

/* ===== NAVBAR ===== */
header {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 30px;
  position: relative;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0d2b2c;
  text-decoration: none;
  margin-right: 40px;
}

/* Wraps both left + right links */
.nav-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-grow: 1;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-draw-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-draw-meta {
  color: #0d2b2c;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* Links */
.nav-left a,
.nav-right a,
.logout-form button {
  color: #0d2b2c;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-left a:hover,
.nav-right a:hover,
.logout-form button:hover {
  color: #f9c74f;
}

/* Sign Up as a green button (keep navbar sizing) */
.nav-right a.nav-signup-btn {
  background: #155e63;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  line-height: 1; /* avoid increasing navbar height */
}
.nav-right a.nav-signup-btn:hover {
  background: #0f3d3e;
  color: #ffffff; /* override generic hover color */
}

/* Hamburger (hidden on desktop) */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #0d2b2c;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  z-index: 1001; /* ensure above slideout */
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: auto;
    right: 8px;
    width: min(92vw, 360px);
    flex-direction: column;
    justify-content: flex-start; /* override desktop space-between */
    align-items: stretch;        /* full-width column */
    gap: 6px;                    /* tighter uniform spacing */
    background: #fff;
    border-top: 1px solid #e5e5e5;
    padding: 10px 14px; /* slightly tighter padding */
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-radius: 8px;
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
  }

  .nav-links.active {
    display: flex;
  }

  /* Flatten groups so items are one uniform list */
  .nav-left, .nav-right { display: contents; }

  /* Unify link/button appearance in the slideout menu */
  .nav-left a,
  .nav-right a:not(.nav-signup-btn),
  .logout-form button {
    width: 100%;
    display: block;
    text-align: left;
    padding: 8px 4px;      /* tighter vertical rhythm */
    margin: 0;             /* override desktop margins for consistency */
    border-bottom: none;   /* remove faint separators */
    line-height: 1.2;      /* unify text height to prevent odd gaps */
    white-space: nowrap;   /* avoid wrapping like "How to\nEarn" */
  }

  /* Keep the Sign Up button compact and tidy */
  .nav-right a.nav-signup-btn {
    display: inline-flex;
    align-self: flex-start;
    width: auto;
    padding: 7px 12px;
    line-height: 1.1;
  }

  /* Hide the greeting on small screens */
  .nav-right span {
    display: none;
  }

  /* Ensure logout button matches link spacing on mobile */
  header .logout-form .logout-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 4px;        /* match link spacing */
    margin: 0;
    line-height: 1.2;        /* match links */
  }
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  color: #555;
}

/* ===== LOGO ===== */
.logo-container {
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;     /* Removes underline */
  color: #0d2b2c;
  transition: color 0.2s ease;
}

.logo-link:hover {
  color: #f9c74f;            /* Same hover as other nav links */
}

.logo-img {
  height: 28px;              /* Matches text size */
  width: auto;
  margin-right: 8px;
  vertical-align: middle;
}

.logo-text {
  font-size: 1.4rem;         /* Slightly larger than other links */
  font-weight: 700;
  line-height: 1;
}

.nav-links {
  margin-left: 30px; /* Adds breathing room after the logo */
}

/* ===== ACCOUNT + LOGOUT MENU FIX ===== */

/* Ensure "Account" link sits properly on the right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Keep Account styled like other nav links */
.nav-right a.nav-link {
  color: #0d2b2c;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}
.nav-right a.nav-link:hover {
  color: #f9c74f;
}

/* Compact balance pill */
.nav-right a.nav-balance {
  background: #f0fdfa;
  border: 1px solid #c7f9e9;
  color: #0d2b2c;
  padding: 4px 8px;
  border-radius: 9999px;
  line-height: 1;
}
.nav-right a.nav-balance:hover {
  background: #dcfdf6;
  color: #0d2b2c;
}

/* Attention marker for incomplete profile: clean, obvious pulsing dot */
.nav-right a.nav-link.nav-link-attn { position: relative; }
.nav-right a.nav-link.nav-link-attn::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -6px;
  width: 10px;  /* was 10px */
  height: 10px; /* was 10px */
  background: #f97316; /* amber */
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff; /* ring to separate from background */
}
.nav-right a.nav-link.nav-link-attn::before {
  content: "";
  position: absolute;
  top: -7px;
  right: -9px;
  width: 16px;  /* was 16px */
  height: 16px; /* was 16px */
  border-radius: 9999px;
  border: 2px solid rgba(249, 115, 22, 0.45);
  animation: nav-attn-ping 1.6s cubic-bezier(0.2, 0, 0.2, 1) infinite;
}

@keyframes nav-attn-ping {
  0% { transform: scale(0.8); opacity: 1; }
  80% { transform: scale(1.6); opacity: 0; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-right a.nav-link.nav-link-attn::before { animation: none; }
}

/* Override large button style for the logout in the navbar only */
header .logout-form {
  display: inline;
}

header .logout-form button.logout-btn {
  background: none !important;
  color: #0d2b2c !important;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  padding: 0;
  margin-left: 10px;
  cursor: pointer;
  text-decoration: none;
  width: auto;
  height: auto;
  transition: color 0.2s ease;
}

header .logout-form button.logout-btn:hover {
  color: #f9c74f !important;
}
/* Navbar-only styles (wonâ€™t be affected by account page CSS anymore) */
header .logout-form { display: inline; }
header .logout-form .logout-btn {
  all: unset;                 /* reset any stray button rules */
  color: #0d2b2c;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
header .logout-form .logout-btn:hover { color: #f9c74f; }

/* Final mobile-specific overrides after navbar-only resets */
@media (max-width: 768px) {
  /* Ensure the slideout looks like a uniform list */
  .nav-links { padding: 10px 14px; justify-content: flex-start; align-items: stretch; gap: 6px; }
  .nav-left, .nav-right { display: contents; }
  .nav-left a, .nav-right a:not(.nav-signup-btn) { display: block; width: 100%; text-align: left; padding: 8px 4px; margin: 0; line-height: 1.2; white-space: nowrap; }

  /* Hide greeting on small screens */
  .nav-right span { display: none; }

  /* Make logout form/button match links (override all:unset above) */
  header .logout-form { display: block; width: 100%; margin: 0; }
  header .logout-form .logout-btn {
    all: unset;               /* start clean */
    display: block;           /* full-width row */
    width: 100%;
    text-align: left;
    padding: 8px 4px;         /* match link spacing */
    line-height: 1.2;         /* match links */
    color: #0d2b2c;
    font-weight: 600;
    cursor: pointer;
  }
header .logout-form .logout-btn:hover { color: #f9c74f; }
}

/* ===== SIGNUP GATE MODAL ===== */
body.signup-gate-open {
  overflow: hidden;
}

.signup-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 43, 44, 0.82);
  backdrop-filter: blur(1.5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1400;
}

.signup-gate-modal {
  background: #ffffff;
  border-radius: 12px;
  max-width: 440px;
  width: min(92vw, 440px);
  padding: 28px 26px 26px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  border: 1px solid #e5f1ef;
  position: relative;
  text-align: left;
}

.signup-gate-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: rgba(15, 61, 62, 0.12);
  color: #0d2b2c;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.signup-gate-close:hover {
  background: rgba(15, 61, 62, 0.18);
  transform: scale(1.05);
}

.signup-gate-eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f3d3e;
  font-weight: 700;
  margin-bottom: 10px;
}

.signup-gate-modal h2 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  color: #0d2b2c;
}

.signup-gate-modal p {
  margin: 0 0 20px;
  color: #0d2b2c;
  line-height: 1.5;
}

.signup-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.signup-gate-primary,
.signup-gate-secondary {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.signup-gate-primary {
  background: #155e63;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 61, 62, 0.18);
}

.signup-gate-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 61, 62, 0.25);
}

.signup-gate-secondary {
  background: transparent;
  color: #0d2b2c;
  border: 1px solid rgba(13, 43, 44, 0.18);
}

.signup-gate-secondary:hover {
  background: rgba(15, 61, 62, 0.08);
}

.signup-gate-login-link {
  font-size: 0.95rem;
  text-align: center;
  color: #0f3d3e;
}

.signup-gate-login-link a {
  color: #155e63;
  font-weight: 700;
  text-decoration: none;
}

.signup-gate-login-link a:hover {
  text-decoration: underline;
}

@media (max-width: 520px) {
  .signup-gate-modal {
    padding: 24px 20px 22px;
  }

  .signup-gate-modal h2 {
    font-size: 1.4rem;
  }
}
