/* ==========================================================================
   MYTHICS COMPONENTS — Header, Cards, Search, Badges, Modals
   ========================================================================== */

/* Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-logo-icon {
  width: 2rem;
  height: 2rem;
  color: var(--gold-500);
}

.brand-logo-img {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.25));
}

.footer-logo-img {
  width: 1.85rem;
  height: 1.85rem;
  object-fit: contain;
  border-radius: var(--radius-xs);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--gold-500) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--gold-500);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold-500);
  border-radius: var(--radius-full);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Control Buttons */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-toggle-btn:hover {
  border-color: var(--gold-500);
}

/* Mobile Toggle */
.mobile-nav-toggle {
  display: none;
}

@media (max-width: 992px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 4.5rem;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open {
    display: flex;
  }
  .mobile-nav-toggle {
    display: inline-flex;
  }
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: #0c0d12;
  box-shadow: 0 4px 14px var(--gold-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  color: #0c0d12;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--gold-500);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ==================== HERO SECTION ==================== */
.hero-section {
  position: relative;
  padding: 5rem 0 4rem;
  overflow: hidden;
  text-align: center;
}

.hero-glow-ambient {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 380px;
  background: radial-gradient(circle, var(--gold-glow) 0%, rgba(56, 189, 248, 0.05) 50%, transparent 80%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
}

.hero-badge-wrap {
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

.hero-subtitle {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 2.5rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 760px;
  margin: 0 auto;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold-500);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

@media (max-width: 640px) {
  .hero-stats-strip {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem;
  }
}

/* ==================== CREATURE GRID & CARDS ==================== */
.creature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.creature-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}

.creature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  background: var(--bg-card-hover);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.creature-card:hover .card-media img {
  transform: scale(1.06);
}

.card-floating-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge-culture {
  background: rgba(217, 119, 6, 0.85);
  color: #fff;
  border: none;
}

.badge-classification {
  background: rgba(14, 165, 233, 0.85);
  color: #fff;
  border: none;
}

.card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title-wrap {
  margin-bottom: 0.5rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.card-original-title {
  font-size: 0.82rem;
  color: var(--gold-500);
  font-family: var(--font-body);
  font-weight: 500;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-traits-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.tag-trait {
  font-size: 0.72rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* Power profile mini preview */
.card-power-meter {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.power-meter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.power-meter-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.power-meter-bar {
  width: 70px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.power-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-500), var(--accent-crimson));
  border-radius: var(--radius-full);
}

.power-meter-val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-500);
}

/* ==================== CULTURE CARDS ==================== */
.culture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.culture-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.culture-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-500);
  background: var(--bg-card-hover);
}

.culture-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.culture-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.culture-count-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  color: var(--gold-500);
  border: 1px solid var(--border-subtle);
}

.culture-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== SEARCH & FILTER BAR ==================== */
.filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.search-input-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}

.search-icon-svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.2rem;
  height: 1.2rem;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  background: var(--bg-surface);
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.filter-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--gold-500);
}

.filter-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* ==================== MODAL (Random Encounter, Dialogs) ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  position: relative;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  transform: scale(0.95);
  transition: transform var(--transition-smooth);
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

/* ==================== FOOTER ==================== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2.5rem;
  margin-top: 5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

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

.footer-brand {
  max-width: 440px;
}

.footer-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  line-height: 1.6;
}

.footer-philosophy {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.5;
  border-left: 2px solid var(--gold-500);
  padding-left: 0.75rem;
}

.footer-col-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--gold-500);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
