/* ============================================
   COMPONENTS.CSS — Navigation, Cards, Badges
   ============================================ */

/* ---- NAVIGATION ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-dim);
  z-index: 100;
  transition: border-color var(--transition-med);
}

.nav.scrolled {
  border-bottom-color: rgba(184,41,255,0.2);
}

.nav-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--lux-gold);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.nav-logo .sigil {
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform var(--transition-med);
  user-select: none;
}

.nav-logo .sigil:hover { transform: rotate(20deg) scale(1.2); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--border-radius);
  transition: color var(--transition-fast), background var(--transition-fast);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav-links a.active { color: var(--lux-gold); }

.nav-cta {
  background: linear-gradient(135deg, var(--shadow-purple), var(--shadow-violet));
  color: var(--text-primary) !important;
  padding: 0.4rem 1rem !important;
  border-radius: 20px !important;
}

.nav-cta:hover {
  background: linear-gradient(135deg, var(--motus-teal), var(--motus-cyan)) !important;
  color: var(--bg-deep) !important;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition-med), opacity var(--transition-med);
}

.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile nav */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: rgba(10,10,15,0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-dim);
  z-index: 99;
  padding: 1rem;
  transform: translateY(-100%);
  transition: transform var(--transition-med);
  pointer-events: none;
  visibility: hidden;
}

.nav-mobile.open {
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.nav-mobile-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-mobile-links a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}

.nav-mobile-links a:hover,
.nav-mobile-links a.active {
  color: var(--lux-gold);
  background: rgba(255,215,0,0.05);
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-mobile { display: block; }
  .nav-inner { gap: 0.5rem; }
}

/* Body offset for nav */
body { padding-top: var(--nav-height); }

/* ---- FOOTER ---- */
.footer {
  background: var(--bg-mid);
  border-top: 1px solid var(--border-dim);
  padding: 3rem 1.5rem 2rem;
  margin-top: 5rem;
  position: relative;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand h3 {
  font-family: var(--font-heading);
  color: var(--lux-gold);
  margin-bottom: 0.5rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

.footer-fox {
  opacity: 0.04;
  font-size: 1.2rem;
  cursor: pointer;
  transition: opacity var(--transition-med);
  user-select: none;
}

.footer-fox:hover { opacity: 0.15; }

/* ---- TIP SECTION ---- */
.footer-tip {
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(0,141,228,0.08), rgba(0,141,228,0.03));
  border: 1px solid rgba(0,141,228,0.2);
  border-radius: var(--card-radius);
  text-align: center;
}

.tip-container { max-width: 500px; margin: 0 auto; }

.tip-label {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.tip-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.tip-address {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(0,141,228,0.3);
  border-radius: 8px;
  padding: 0.5rem 1rem;
}

.tip-badge {
  background: linear-gradient(135deg, #008de4, #00aaff);
  color: white;
  font-family: var(--font-code);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.tip-username {
  font-family: var(--font-code);
  font-size: 1.1rem;
  color: #00aaff;
  background: transparent;
  padding: 0;
}

.tip-copy-btn {
  background: rgba(0,141,228,0.15);
  border: 1px solid rgba(0,141,228,0.3);
  color: var(--text-secondary);
  font-family: var(--font-code);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tip-copy-btn:hover {
  background: rgba(0,141,228,0.3);
  color: white;
}

/* ---- AUGUST BIO CARD ---- */
.august-bio {
  background: var(--bg-card);
  border: 1px solid rgba(255,215,0,0.1);
  border-radius: var(--card-radius);
  position: relative;
  overflow: hidden;
}

.august-bio::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(0,255,204,0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(184,41,255,0.03) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 50%, rgba(255,215,0,0.02) 0%, transparent 40%);
  animation: auroraShift 12s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

.august-bio > * {
  position: relative;
  z-index: 1;
}

@keyframes auroraShift {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -1%) rotate(1deg); }
  66% { transform: translate(-1%, 2%) rotate(-0.5deg); }
  100% { transform: translate(1%, -2%) rotate(0.5deg); }
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  transition: all var(--transition-med);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  padding: 1px;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(184,41,255,0.2) 50%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-med);
  pointer-events: none;
}

.card:hover::before { opacity: 1; }
.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* Animated gradient border card */
.card-magic {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--card-radius);
  padding: 1.5rem;
}

.card-magic::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--card-radius) + 1px);
  background: conic-gradient(
    from var(--angle, 0deg),
    var(--shadow-purple),
    var(--motus-teal),
    var(--lux-gold),
    var(--shadow-purple)
  );
  animation: spin-border 4s linear infinite;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-med);
}

.card-magic:hover::before { opacity: 1; }

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes spin-border {
  to { --angle: 360deg; }
}

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-code);
  letter-spacing: 0.05em;
}

.badge-built { background: rgba(0,255,0,0.1); color: #00ff88; border: 1px solid rgba(0,255,0,0.2); }
.badge-buildable { background: rgba(0,120,255,0.1); color: #4499ff; border: 1px solid rgba(0,120,255,0.2); }
.badge-emerging { background: rgba(255,215,0,0.1); color: var(--lux-gold); border: 1px solid rgba(255,215,0,0.2); }
.badge-arcane { background: rgba(255,50,50,0.1); color: #ff6666; border: 1px solid rgba(255,50,50,0.2); }

.badge-lux { background: rgba(255,215,0,0.1); color: var(--lux-gold); border: 1px solid rgba(255,215,0,0.2); }
.badge-shadow { background: rgba(184,41,255,0.1); color: var(--shadow-purple); border: 1px solid rgba(184,41,255,0.2); }
.badge-motus { background: rgba(0,255,204,0.1); color: var(--motus-teal); border: 1px solid rgba(0,255,204,0.2); }
.badge-wicked { background: rgba(255,68,68,0.1); color: var(--ember-red); border: 1px solid rgba(255,68,68,0.2); }
.badge-claw { background: rgba(255,140,0,0.1); color: #ff8c00; border: 1px solid rgba(255,140,0,0.2); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-med);
  border: none;
  letter-spacing: 0.03em;
  font-family: var(--font-body);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--shadow-purple), var(--shadow-violet));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--motus-teal), var(--motus-cyan));
  color: var(--bg-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,255,204,0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-dim);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--motus-teal);
  background: rgba(0,255,204,0.05);
}

.btn-gold {
  background: linear-gradient(135deg, var(--lux-gold), var(--lux-amber));
  color: var(--bg-deep);
  font-weight: 700;
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,215,0,0.3);
}

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }

/* ---- QUOTE BLOCK ---- */
.grimoire-quote {
  border-left: 3px solid var(--shadow-purple);
  padding: 1.5rem;
  margin: 2rem 0;
  background: rgba(184,41,255,0.04);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.grimoire-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: normal;
  font-family: var(--font-code);
}

/* ---- ALERT / FLASH ---- */
.flash-overlay {
  position: fixed;
  inset: 0;
  background: rgba(184,41,255,0.15);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.flash-overlay.show { opacity: 1; pointer-events: all; }

.flash-message {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 3rem);
  color: var(--shadow-purple);
  text-shadow: 0 0 40px var(--shadow-purple), 0 0 80px rgba(184,41,255,0.5);
  text-align: center;
  letter-spacing: 0.1em;
  animation: pulseGlow 0.5s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  from { text-shadow: 0 0 20px var(--shadow-purple); }
  to   { text-shadow: 0 0 60px var(--shadow-purple), 0 0 100px rgba(184,41,255,0.7); }
}

/* ---- CUSTOM CONTEXT MENU ---- */
.custom-context-menu {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--border-radius);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: var(--shadow-purple);
  pointer-events: none;
  opacity: 0;
  z-index: 9998;
  transition: opacity 0.2s;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(184,41,255,0.2);
}

.custom-context-menu.show { opacity: 1; }

/* ---- RUNE ANIMATION ---- */
.rune-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s;
}

.rune-overlay.show { opacity: 1; }

.rune-circle {
  width: 300px;
  height: 300px;
  border: 2px solid var(--motus-teal);
  border-radius: 50%;
  position: relative;
  animation: runeRotate 2s linear infinite;
  box-shadow: 0 0 40px rgba(0,255,204,0.2), inset 0 0 40px rgba(0,255,204,0.05);
}

.rune-circle::before {
  content: 'ᚠ ᚢ ᚦ ᚨ ᚱ ᚲ ᚷ ᚹ ᚺ ᚾ ᛁ ᛃ';
  position: absolute;
  inset: -20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--motus-teal);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-shadow: 0 0 10px var(--motus-teal);
}

@keyframes runeRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---- ARCANE TOOLTIP ---- */
.arcane-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid rgba(255,50,50,0.3);
  border-radius: var(--border-radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-style: italic;
  color: #ff9999;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-med);
  z-index: 100;
  box-shadow: 0 4px 16px rgba(255,50,50,0.15);
}

.arcane-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(255,50,50,0.3);
}

/* ---- SEARCH / FILTER ---- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 2rem;
  overflow-x: auto;
  max-width: 100%;
}

.filter-input {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--border-radius);
  padding: 0.6rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}

.filter-input:focus {
  outline: none;
  border-color: var(--motus-teal);
}

.filter-input::placeholder { color: var(--text-muted); }

.filter-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
  white-space: nowrap;
}

.filter-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.filter-btn.active { border-color: var(--motus-teal); color: var(--motus-teal); background: rgba(0,255,204,0.05); }
.filter-btn.lux-active { border-color: var(--lux-gold); color: var(--lux-gold); background: rgba(255,215,0,0.05); }
.filter-btn.shadow-active { border-color: var(--shadow-purple); color: var(--shadow-purple); background: rgba(184,41,255,0.05); }
.filter-btn.motus-active { border-color: var(--motus-teal); color: var(--motus-teal); background: rgba(0,255,204,0.05); }
.filter-btn.wicked-active { border-color: var(--ember-red); color: var(--ember-red); background: rgba(255,68,68,0.05); }
