/* ================================================================
   next-components.css — Shared UI components
   Uses --next-* design tokens from next-base.css
   ================================================================ */

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */
.next-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  background: rgba(3, 8, 20, 0.86);
  border-bottom: 1px solid rgba(29, 231, 255, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.next-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.next-header__brand {
  display: flex;
  align-items: center;
  gap: var(--next-space-2);
  text-decoration: none;
}

.next-header__logo {
  height: 28px;
  width: auto;
}

.next-header__nav {
  display: flex;
  align-items: center;
  gap: var(--next-space-4);
}

.next-header__link {
  font-size: var(--next-font-sm);
  font-weight: 600;
  color: var(--next-text-secondary);
  padding: var(--next-space-2) var(--next-space-3);
  border-radius: var(--next-radius-sm);
  transition:
    color var(--next-transition-fast),
    background var(--next-transition-fast);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.next-header__link:hover {
  color: var(--next-text-primary);
  background: rgba(29, 231, 255, 0.08);
}

.next-header__link--active,
.next-header__link:active {
  color: var(--next-cyan);
  text-shadow: 0 0 12px rgba(29, 231, 255, 0.4);
}

.next-header__link:focus-visible {
  outline: 2px solid var(--next-cyan);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  .next-header {
    height: 72px;
  }

  .next-header__logo {
    height: 32px;
  }
}

/* ------------------------------------------------------------------
   Section header
   ------------------------------------------------------------------ */
.next-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--next-space-4);
  margin-bottom: var(--next-space-5);
}

.next-section-header__title {
  font-size: var(--next-font-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--next-text-primary);
  text-transform: uppercase;
}

/* ------------------------------------------------------------------
   Tabs
   ------------------------------------------------------------------ */
.next-tabs {
  display: flex;
  gap: 2px;
  background: var(--next-bg-800);
  border-radius: var(--next-radius-pill);
  padding: 3px;
  border: 1px solid var(--next-border-muted);
}

.next-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--next-space-2);
  padding: var(--next-space-2) var(--next-space-5);
  font-size: var(--next-font-sm);
  font-weight: 600;
  color: var(--next-text-muted);
  border-radius: var(--next-radius-pill);
  text-decoration: none;
  transition:
    color var(--next-transition-normal),
    background var(--next-transition-normal),
    box-shadow var(--next-transition-normal);
  white-space: nowrap;
}

.next-tab:hover {
  color: var(--next-text-secondary);
}

.next-tab--active {
  background: var(--next-surface-strong);
  color: var(--next-cyan);
  box-shadow:
    0 0 16px rgba(29, 231, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.next-tab__badge {
  font-size: var(--next-font-xs);
  background: rgba(29, 231, 255, 0.14);
  color: var(--next-cyan);
  border-radius: var(--next-radius-pill);
  padding: 1px 8px;
  font-weight: 700;
}

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.next-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--next-space-2);
  padding: var(--next-space-3) var(--next-space-6);
  font-size: var(--next-font-sm);
  font-weight: 700;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: var(--next-radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--next-transition-fast),
    border-color var(--next-transition-fast),
    box-shadow var(--next-transition-fast),
    transform var(--next-transition-fast);
  min-height: 44px;
  white-space: nowrap;
}

.next-btn__icon {
  flex-shrink: 0;
  transition: transform var(--next-transition-fast);
}

.next-btn:hover .next-btn__icon {
  transform: translateX(2px);
}

.next-btn--primary {
  background: linear-gradient(135deg, var(--next-cyan), var(--next-blue));
  color: var(--next-bg-950);
  border-color: transparent;
}

.next-btn--primary:hover {
  box-shadow: 0 0 24px rgba(29, 231, 255, 0.3);
  transform: translateY(-1px);
}

.next-btn--primary:focus-visible {
  outline: 2px solid var(--next-cyan);
  outline-offset: 2px;
}

.next-btn--secondary {
  background: transparent;
  color: var(--next-text-primary);
  border-color: var(--next-border-strong);
}

.next-btn--secondary:hover {
  background: rgba(29, 231, 255, 0.08);
  border-color: var(--next-cyan);
  box-shadow: 0 0 16px rgba(29, 231, 255, 0.12);
}

.next-btn--outline {
  background: transparent;
  color: var(--next-text-secondary);
  border-color: var(--next-border-muted);
}

.next-btn--outline:hover {
  border-color: var(--next-border-strong);
  color: var(--next-text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.next-btn--sm {
  padding: var(--next-space-2) var(--next-space-4);
  font-size: var(--next-font-xs);
  min-height: 36px;
}

/* ------------------------------------------------------------------
   Badges / Chips
   ------------------------------------------------------------------ */
.next-badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--next-font-xs);
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--next-radius-pill);
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.next-badge--class {
  background: rgba(138, 69, 255, 0.16);
  color: var(--next-purple-light);
  border: 1px solid rgba(138, 69, 255, 0.24);
}

.next-badge--today {
  background: rgba(54, 245, 155, 0.14);
  color: var(--next-green);
  border: 1px solid rgba(54, 245, 155, 0.24);
}

.next-badge--upcoming {
  background: rgba(19, 186, 255, 0.14);
  color: var(--next-blue);
  border: 1px solid rgba(19, 186, 255, 0.24);
}

.next-badge--ended {
  background: rgba(230, 238, 255, 0.06);
  color: var(--next-text-muted);
  border: 1px solid var(--next-border-muted);
}

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.next-footer {
  margin-top: var(--next-space-12);
  padding: var(--next-space-10) 0 var(--next-space-8);
  border-top: 1px solid var(--next-border-muted);
  background:
    linear-gradient(180deg, transparent 0%, var(--next-bg-850) 100%);
}

.next-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--next-space-8);
}

.next-footer__col--brand {
  grid-column: 1 / -1;
}

.next-footer__logo-link {
  display: inline-block;
  margin-bottom: var(--next-space-3);
}

.next-footer__logo {
  height: 24px;
  width: auto;
}

.next-footer__description {
  color: var(--next-text-secondary);
  font-size: var(--next-font-sm);
  line-height: 1.6;
  margin: 0 0 var(--next-space-3);
  max-width: 36ch;
}

.next-footer__copyright {
  color: var(--next-text-muted);
  font-size: var(--next-font-xs);
  margin: 0;
}

.next-footer__heading {
  font-size: var(--next-font-xs);
  font-weight: 700;
  color: var(--next-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--next-space-3);
}

.next-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--next-space-2);
}

.next-footer__link {
  font-size: var(--next-font-sm);
  color: var(--next-text-secondary);
  text-decoration: none;
  transition: color var(--next-transition-fast);
}

.next-footer__link:hover {
  color: var(--next-cyan);
}

.next-footer__social {
  display: flex;
  gap: var(--next-space-3);
}

.next-footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--next-text-muted);
  background: rgba(255, 255, 255, 0.04);
  transition:
    color var(--next-transition-fast),
    background var(--next-transition-fast);
}

.next-footer__social-link:hover {
  color: var(--next-cyan);
  background: rgba(29, 231, 255, 0.1);
}

@media (min-width: 640px) {
  .next-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .next-footer__col--brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .next-footer__grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .next-footer__col--brand {
    grid-column: auto;
  }
}

/* ------------------------------------------------------------------
   Empty state
   ------------------------------------------------------------------ */
.next-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--next-space-10) var(--next-space-4);
}

.next-empty-state__icon {
  color: var(--next-text-muted);
  margin-bottom: var(--next-space-4);
  opacity: 0.6;
}

.next-empty-state__message {
  color: var(--next-text-secondary);
  font-size: var(--next-font-lg);
  margin: 0 0 var(--next-space-6);
  max-width: 48ch;
}

.next-empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--next-space-3);
  justify-content: center;
}

/* ------------------------------------------------------------------
   Error state
   ------------------------------------------------------------------ */
.next-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--next-space-10) var(--next-space-4);
  background: rgba(255, 77, 109, 0.04);
  border: 1px solid rgba(255, 77, 109, 0.18);
}

.next-error-state__icon {
  margin-bottom: var(--next-space-3);
}

.next-error-state__message {
  color: var(--next-text-secondary);
  font-size: var(--next-font-md);
  margin: 0 0 var(--next-space-5);
  max-width: 52ch;
}

/* ------------------------------------------------------------------
   Loading skeleton
   ------------------------------------------------------------------ */
.next-skeleton {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--next-border-muted);
  border-radius: var(--next-radius-lg);
  background: var(--next-surface);
}

.next-skeleton__image {
  aspect-ratio: 4 / 5;
  background: rgba(255, 255, 255, 0.03);
}

.next-skeleton__image--16x9 {
  aspect-ratio: 16 / 9;
}

.next-skeleton__body {
  padding: var(--next-space-4);
  position: relative;
}

.next-skeleton__logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  position: absolute;
  top: -22px;
  right: var(--next-space-4);
  border: 2px solid var(--next-border-muted);
}

.next-skeleton__line {
  height: 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: var(--next-space-2);
  animation: next-skeleton-pulse 2s ease-in-out infinite;
}

.next-skeleton__line--title {
  width: 70%;
  height: 18px;
}

.next-skeleton__line--meta {
  width: 55%;
}

.next-skeleton__line--short {
  width: 35%;
}

.next-skeleton__line--btn {
  width: 40%;
  height: 32px;
  border-radius: var(--next-radius-pill);
  margin-top: var(--next-space-3);
}

@keyframes next-skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* ------------------------------------------------------------------
   Pagination placeholder
   ------------------------------------------------------------------ */
.next-pagination {
  display: flex;
  justify-content: center;
}

/* ------------------------------------------------------------------
   Accessibility
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .next-skeleton__line {
    animation: none;
  }

  .next-btn:hover .next-btn__icon {
    transform: none;
  }
}
