/* ============================================================
   KOJILABS — Component Library
   
   Every UI building block: buttons, cards, badges, filters,
   theme switcher, discord banner, empty states, and the
   mobile navigation overlay.
   ============================================================ */


/* ────────────────────────────────────────────────────────────
   B U T T O N S
   ──────────────────────────────────────────────────────────── */

/* Base button — shared structure for all variants. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--btn-radius);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  border: none;
  outline: none;
  white-space: nowrap;
}

/* Primary — solid accent fill, the main CTA. */
.btn--primary {
  background: var(--accent);
  color: var(--bg);
}

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Secondary — subtle surface with border. */
.btn--secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
}

.btn--secondary:hover {
  background: var(--surface-hover);
}

/* Ghost — invisible until hovered. */
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}

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

/* Discord — neutral glass CTA. */
.btn--discord {
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.btn--discord:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Large variant — for hero sections. */
.btn--lg {
  padding: 16px 36px;
  font-size: var(--text-md);
}


/* ────────────────────────────────────────────────────────────
   P R O D U C T   C A R D S
   
   Glass-effect cards showcasing products with icon, name,
   description, and feature list.
   ──────────────────────────────────────────────────────────── */
.product-card {
  /* Glass surface */
  -webkit-backdrop-filter: blur(var(--blur-strength));
          backdrop-filter: blur(var(--blur-strength));
  background: var(--blur-tint);
  border: 1px solid var(--surface-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);

  padding: var(--space-xl);
  transition: all 0.4s ease;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--accent), 0.3);
  /* Fallback for themes where --accent isn't an rgba value */
  border-color: var(--surface-hover);
}

/* ── Icon ──────────────────────────────────────── */
.product-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  font-size: 24px;
}

/* ── Text ──────────────────────────────────────── */
.product-card__name {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.product-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

/* ── Feature List ──────────────────────────────── */
.product-card__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.product-card__feature {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-card__feature::before {
  content: '✦';
  color: var(--accent);
  font-size: 10px;
  flex-shrink: 0;
}


/* ────────────────────────────────────────────────────────────
   P O S T   C A R D S
   
   Content feed entries with header metadata, badges,
   body text, embeds, and external link previews.
   ──────────────────────────────────────────────────────────── */
@keyframes postCardPulse {
  0%, 100% {
    box-shadow: 0 0 20px var(--accent-glow),
                0 0 40px var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 40px var(--accent-glow),
                0 0 80px var(--accent-glow),
                0 0 120px var(--accent-glow);
  }
}

.post-card {
  /* Glass surface */
  -webkit-backdrop-filter: blur(var(--blur-strength));
          backdrop-filter: blur(var(--blur-strength));
  background: var(--blur-tint);
  border: 1px solid var(--accent);
  border-radius: var(--card-radius);
  animation: postCardPulse 3s infinite ease-in-out;

  padding: var(--space-lg);
  transition: all 0.3s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  animation: postCardPulse 1.5s infinite ease-in-out;
  border-color: var(--accent);
}

/* ── Header ────────────────────────────────────── */
.post-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.post-card__date {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ── Pin Indicator ─────────────────────────────── */
.post-card__pin {
  font-size: var(--text-xs);
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Badges — type indicators ──────────────────── */
.post-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-card__badge--video {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
}

.post-card__badge--link {
  background: rgba(59, 130, 246, 0.12);
  color: #3B82F6;
}

.post-card__badge--update {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
}

.post-card__badge--clip {
  background: rgba(168, 85, 247, 0.12);
  color: #A855F7;
}

.post-card__badge--partner {
  background: rgba(245, 158, 11, 0.12); /* Amber/Gold */
  color: #F59E0B;
}

/* ── Body Content ──────────────────────────────── */
.post-card__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
  color: var(--text-primary);
}

.post-card__content {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

/* ── Embed Container ──────────────────────────── */
.post-card__embed {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: var(--space-md);
  aspect-ratio: 16 / 9;
  background: var(--surface);
}

.post-card__embed iframe,
.post-card__embed video {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
  background-color: #000;
}

/* ── Link Preview ──────────────────────────────── */
.post-card__link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--surface);
  border-radius: 12px;
  transition: all 0.3s ease;
  text-decoration: none;
  border: 1px solid var(--surface-border);
}

.post-card__link:hover {
  background: var(--surface-hover);
  border-color: var(--accent-glow);
}

.post-card__link-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.post-card__link-info {
  flex: 1;
  min-width: 0; /* Allow text truncation inside flex */
}

.post-card__link-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.post-card__link-url {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ────────────────────────────────────────────────────────────
   F I L T E R   B U T T O N S
   
   Pill-shaped toggles for feed category filtering.
   ──────────────────────────────────────────────────────────── */
.filter-btn {
  padding: 8px 20px;
  border-radius: 100px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
}

.filter-btn:hover {
  color: var(--text-primary);
  background: var(--surface);
}

.filter-btn--active {
  color: var(--accent);
  background: var(--surface);
  border-color: var(--surface-border);
}


/* ────────────────────────────────────────────────────────────
   T H E M E   S W I T C H E R
   
   A single button with a color dot that opens a dropdown
   panel to select between themes.
   ──────────────────────────────────────────────────────────── */
.theme-switcher {
  position: relative;
}

/* Toggle Button */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.theme-toggle-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-glow);
}

.theme-toggle-btn--open {
  background: var(--surface-hover);
}

.theme-toggle-btn__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.theme-toggle-btn__chevron {
  transition: transform 0.3s ease;
  opacity: 0.5;
}

.theme-toggle-btn--open .theme-toggle-btn__chevron {
  transform: rotate(180deg);
}

/* Dropdown Panel */
.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  background: var(--blur-tint);
  -webkit-backdrop-filter: blur(24px);
          backdrop-filter: blur(24px);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-dropdown--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Dropdown Items */
.theme-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: var(--text-sm);
  font-weight: 500;
  outline: none;
}

.theme-dropdown__item:hover {
  background: var(--surface);
  color: var(--text-primary);
}

.theme-dropdown__item--active {
  color: var(--accent);
}

.theme-dropdown__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.theme-dropdown__label {
  flex: 1;
  text-align: left;
}

.theme-dropdown__check {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}


/* ────────────────────────────────────────────────────────────
   D I S C O R D   B A N N E R   E L E M E N T S
   ──────────────────────────────────────────────────────────── */
.discord__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3; /* Leichte Transparenz, damit der Text lesbar bleibt */
  z-index: 0;
  pointer-events: none;
  filter: grayscale(20%); /* Passt sich besser an dunkle Themes an */
}

.discord__content {
  position: relative;
  z-index: 1;
}

.discord__icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
}

.discord__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.discord__desc {
  font-size: var(--text-md);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}


/* ────────────────────────────────────────────────────────────
   E M P T Y   S T A T E
   
   Shown when a feed filter yields no results.
   ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-tertiary);
}

.empty-state__icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state__text {
  font-size: var(--text-md);
}


/* ────────────────────────────────────────────────────────────
   M O B I L E   M E N U
   
   Hamburger button (three bars) and fullscreen overlay nav
   that appears on smaller viewports.
   ──────────────────────────────────────────────────────────── */

/* Hamburger trigger — hidden on desktop */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
}

.mobile-menu-btn span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Hamburger → X animation when open */
.mobile-menu-btn--active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn--active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn--active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}


/* ────────────────────────────────────────────────────────────
   H E R O   G L O W
   
   Subtle radial background accent for the hero section.
   ──────────────────────────────────────────────────────────── */
.hero {
  position: relative;
}

.hero__glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(
    ellipse at center,
    var(--accent-glow) 0%,
    transparent 70%
  );
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

.hero__title-accent {
  background: linear-gradient(135deg, var(--accent), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ────────────────────────────────────────────────────────────
   P O S T   U P D A T E   V A R I A N T
   
   Update-type posts get a subtle accent left border.
   ──────────────────────────────────────────────────────────── */
.post-card--update {
  border-left: 3px solid var(--accent);
}


/* ────────────────────────────────────────────────────────────
   L I N K   A R R O W
   ──────────────────────────────────────────────────────────── */
.post-card__link-arrow {
  font-size: 18px;
  color: var(--text-tertiary);
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
}

.post-card__link:hover .post-card__link-arrow {
  transform: translateX(4px);
  color: var(--accent);
}


/* ────────────────────────────────────────────────────────────
   N A V   D I S C O R D   B U T T O N
   ──────────────────────────────────────────────────────────── */
.btn--nav {
  padding: 8px 16px;
  font-size: var(--text-xs);
  border-radius: 100px;
}

@media (max-width: 768px) {
  .btn--nav {
    display: none;
  }
}


/* ────────────────────────────────────────────────────────────
   F O O T E R   D E T A I L S
   ──────────────────────────────────────────────────────────── */
.footer__content {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-lg);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.footer__tagline {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.footer__links {
  display: flex;
  gap: var(--space-lg);
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer__link:hover {
  color: var(--text-primary);
}

.footer__bottom {
  padding-top: var(--space-md);
  border-top: 1px solid var(--surface-border);
  width: 100%;
  text-align: center;
}


/* ────────────────────────────────────────────────────────────
   F E E D   E M P T Y   ( alternate class from posts.js )
   ──────────────────────────────────────────────────────────── */
.feed-empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-tertiary);
}

.feed-empty__icon {
  font-size: 48px;
  display: block;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.feed-empty__text {
  font-size: var(--text-md);
}

/* Fullscreen overlay — hidden by default */
.mobile-nav {
  display: none;
}

/* Show on tablet / mobile */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .mobile-nav--open {
    display: flex;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--blur-tint);
    -webkit-backdrop-filter: blur(20px);
            backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    z-index: 999;
    animation: fadeIn 0.3s ease;
  }

  .mobile-nav a {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
  }

  .mobile-nav a:hover {
    color: var(--accent);
  }
}

/* ────────────────────────────────────────────────────────────
   F O L L O W E R S
   ──────────────────────────────────────────────────────────── */
@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.followers-marquee-wrapper {
  overflow: hidden;
  width: 100%;
  position: relative;
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.followers-grid {
  display: flex;
  width: max-content;
  gap: 24px;
  margin-top: 40px;
  animation: marquee 15s linear infinite;
}

.followers-grid:hover {
  animation-play-state: paused;
}

.follower-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  min-width: 250px;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.follower-card:hover {
  transform: translateY(-4px);
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.follower-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  border: 2px solid var(--surface-border);
}

.follower-card__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.follower-card__name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.follower-card__badge {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(138, 43, 226, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  width: fit-content;
}

