/* ==========================================================================
   THE FLYING DUTCHMEN - SHARED NAVIGATION & HEADER DESIGN SYSTEM
   Used across Home, Lobby, Forum, Stats & all official apps
   ========================================================================== */

:root {
  --tfd-bg-dark: #081108;
  --tfd-bg-surface: rgba(16, 28, 16, 0.85);
  --tfd-bg-surface-elevated: rgba(24, 42, 22, 0.95);
  --tfd-border-gold: rgba(212, 175, 55, 0.28);
  --tfd-border-gold-bright: rgba(212, 175, 55, 0.55);
  --tfd-gold-primary: #d4af37;
  --tfd-gold-light: #f5d77f;
  --tfd-gold-dark: #aa820a;
  --tfd-gold-gradient: linear-gradient(135deg, #ffffff 0%, #f7df8b 60%, #d4af37 100%);
  --tfd-emerald-primary: #2d5016;
  --tfd-emerald-accent: #4a7c2c;
  --tfd-emerald-bright: #6b9440;
  --tfd-text-main: #f8fafc;
  --tfd-text-secondary: #cbd5e1;
  --tfd-text-muted: #94a3b8;
  --tfd-danger: #ef4444;
}

/* ==========================================================================
   TOP NAVIGATION BAR - MOBILE FIRST (Clean 2-Row Portrait Layout)
   ========================================================================== */
.tfd-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(8, 17, 8, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--tfd-border-gold, rgba(212, 175, 55, 0.28));
  padding: 0.6rem 1rem 0.55rem 1rem;
}

.tfd-navbar-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Brand Title Row */
.tfd-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.tfd-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--tfd-text-main, #f8fafc);
  transition: opacity 0.2s ease;
}

.tfd-brand:hover {
  opacity: 0.9;
  color: var(--tfd-text-main, #f8fafc);
}

.tfd-brand-text {
  background: var(--tfd-gold-gradient, linear-gradient(135deg, #ffffff 0%, #f7df8b 60%, #d4af37 100%));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

/* Actions Row (Language on left, Login / User & Mobile Toggle on right) */
.tfd-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
}

.tfd-actions-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.tfd-actions-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Desktop Navigation Links (Hidden on Mobile Portrait) */
.tfd-nav-links {
  display: none;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tfd-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--tfd-text-secondary, #cbd5e1);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.tfd-nav-link:hover {
  color: var(--tfd-gold-light, #f5d77f);
  background: rgba(212, 175, 55, 0.1);
}

.tfd-nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(74, 124, 44, 0.4) 0%, rgba(45, 80, 22, 0.6) 100%);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

/* Language Icon Button */
.tfd-icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--tfd-text-secondary, #cbd5e1);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 34px;
}

.tfd-icon-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--tfd-border-gold, rgba(212, 175, 55, 0.28));
  color: var(--tfd-gold-light, #f5d77f);
}

/* Golden Login Button */
.tfd-btn-login {
  background: linear-gradient(135deg, #e5be48 0%, #d4af37 50%, #aa820a 100%);
  color: #0d1509 !important;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.38rem 0.85rem;
  border-radius: 8px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(212, 175, 55, 0.25);
  transition: all 0.2s ease;
  min-height: 34px;
  white-space: nowrap;
}

.tfd-btn-login:hover {
  background: linear-gradient(135deg, #f3cb53 0%, #e0bc43 50%, #b88d0d 100%);
  color: #0d1509 !important;
  text-decoration: none;
}

/* User Pill Badge */
.tfd-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--tfd-bg-surface, rgba(16, 28, 16, 0.85));
  border: 1px solid var(--tfd-border-gold, rgba(212, 175, 55, 0.28));
  padding: 0.28rem 0.65rem;
  border-radius: 20px;
  font-size: 0.8rem;
  min-height: 34px;
  color: var(--tfd-text-main, #f8fafc);
}

.tfd-user-role {
  background: var(--tfd-emerald-accent, #4a7c2c);
  color: var(--tfd-gold-light, #f5d77f);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.tfd-user-logout {
  background: transparent;
  border: none;
  color: var(--tfd-danger, #ef4444);
  padding: 0 0 0 2px;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.tfd-user-logout:hover {
  opacity: 0.8;
  color: #f87171;
}

/* Mobile Toggle Hamburger Button */
.tfd-mobile-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--tfd-border-gold, rgba(212, 175, 55, 0.28));
  color: var(--tfd-gold-primary, #d4af37);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  padding: 0;
  transition: all 0.2s ease;
}

.tfd-mobile-toggle:hover {
  background: rgba(212, 175, 55, 0.15);
  color: var(--tfd-gold-light, #f5d77f);
}

/* Mobile Drawer Overlay */
.tfd-mobile-drawer {
  display: none;
  position: fixed;
  top: 86px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 17, 8, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999;
  padding: 1.25rem 1rem;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  border-top: 1px solid var(--tfd-border-gold, rgba(212, 175, 55, 0.28));
}

.tfd-mobile-drawer.open {
  display: flex;
  animation: drawerFadeIn 0.2s ease-out;
}

@keyframes drawerFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tfd-mobile-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--tfd-text-main, #f8fafc);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}

.tfd-mobile-link:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--tfd-border-gold, rgba(212, 175, 55, 0.28));
  color: var(--tfd-gold-light, #f5d77f);
}

.tfd-mobile-link.active {
  background: linear-gradient(135deg, rgba(74, 124, 44, 0.3) 0%, rgba(45, 80, 22, 0.5) 100%);
  border: 1px solid var(--tfd-border-gold, rgba(212, 175, 55, 0.28));
  color: #ffffff;
}

/* ==========================================================================
   DESKTOP EXPANSION (min-width: 768px)
   ========================================================================== */
@media (min-width: 768px) {
  .tfd-navbar {
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
  }

  .tfd-navbar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .tfd-brand-row {
    width: auto;
    justify-content: flex-start;
  }

  .tfd-brand-text {
    font-size: 1.15rem;
  }

  .tfd-actions-row {
    width: auto;
    justify-content: flex-end;
  }

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

  .tfd-mobile-toggle {
    display: none;
  }

  .tfd-mobile-drawer {
    display: none !important;
  }
}
