/* ============================================
   KALSHI RESEARCH ASSISTANT — Component Styles
   Nav · Hero · Report Cards · Report Viewer ·
   Submit Form · Footer · Utilities
   ============================================ */

/* =============================================
   NAVIGATION
   ============================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.25rem 0;
  transition: background var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.nav.scrolled {
  background: rgba(17, 15, 12, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}

.nav__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--duration-fast);
}

.nav__logo:hover {
  color: var(--accent);
}

.nav__logo-icon {
  color: var(--accent);
  font-size: 1.1rem;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.nav__link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  transition: color var(--duration-fast);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--duration-normal) var(--ease-out);
}

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

.nav__link:hover::after {
  width: 100%;
}

.nav__link--active {
  color: var(--text-primary);
}

.nav__link--active::after {
  width: 100%;
}

/* Nav toggle — mobile hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px 0;
}

.nav__toggle span {
  display: block;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--duration-fast) var(--ease-out),
              opacity var(--duration-fast);
}

.nav__toggle.active span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 5rem 2rem 2rem;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform var(--duration-normal) var(--ease-out);
  }

  .nav__links.open {
    transform: translateX(0);
  }

  .nav__link {
    font-size: 1.1rem;
    padding: 0.75rem 0;
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  .nav__link::after {
    display: none;
  }
}

/* Mobile overlay backdrop */
.nav__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.nav__overlay.visible {
  display: block;
  opacity: 1;
}


/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  overflow: hidden;
}

/* Subtle animated ambient glow — violet tones */
.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -30%;
  width: 160%;
  height: 160%;
  background:
    radial-gradient(ellipse 600px 500px at 25% 45%, rgba(123, 104, 238, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 75% 70%, rgba(80, 200, 120, 0.03) 0%, transparent 60%);
  animation: heroGlow 18s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroGlow {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(3%, -2%) scale(1.05); }
}

/* Dot grid */
.hero__grid-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(123, 104, 238, 0.1) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 70%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.hero__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.4rem 1rem;
  border: 1px solid rgba(123, 104, 238, 0.25);
  border-radius: 100px;
  margin-bottom: var(--space-md);
}

.hero__heading {
  margin-bottom: var(--space-md);
  font-weight: 400;
  color: var(--text-primary);
}

.hero__accent {
  color: var(--accent);
  font-style: italic;
}

.hero__subtext {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: var(--space-md);
}

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

/* Stagger animation on hero children */
.hero [data-animate]:nth-child(1) { transition-delay: 0.1s; }
.hero [data-animate]:nth-child(2) { transition-delay: 0.25s; }
.hero [data-animate]:nth-child(3) { transition-delay: 0.4s; }
.hero [data-animate]:nth-child(4) { transition-delay: 0.55s; }

/* Scroll cue */
.hero__scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: scrollBounce 2.5s ease-in-out infinite;
}

.hero__scroll-cue span {
  display: block;
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(6px); }
}


/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.btn--primary:hover {
  background: #6A58DD;
  border-color: #6A58DD;
  box-shadow: 0 4px 20px rgba(123, 104, 238, 0.25);
}

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

.btn--secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-elevated);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
}

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

.btn--sm {
  font-size: 0.8rem;
  padding: 0.5rem 1.15rem;
}

.btn--lg {
  font-size: 1rem;
  padding: 0.9rem 2.25rem;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}


/* =============================================
   REPORT CARDS — Grid + Card Styles
   ============================================= */
.reports-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.reports__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
  flex-wrap: wrap;
}

.reports__header-text h2 {
  margin-bottom: 0.35rem;
}

.reports__count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reports__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-md);
}

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

  .reports__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- Report Card --- */
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition:
    background var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

/* Top accent bar */
.report-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform var(--duration-normal) var(--ease-out);
}

.report-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px var(--border-light),
    0 0 60px -20px var(--accent);
}

.report-card:hover::before {
  transform: scaleX(1);
}

/* Card accent color variants — override the top bar per status */
.report-card--completed::before {
  background: var(--success);
}

.report-card--running::before {
  background: var(--accent);
}

.report-card--pending::before {
  background: var(--pending);
}

.report-card--failed::before {
  background: var(--error);
}

/* Card head — status badge + date */
.report-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.report-card__date {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Card body */
.report-card__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.report-card__market {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card footer — source tag + arrow */
.report-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.report-card__source {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 100px;
}

.report-card__arrow {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--duration-fast), transform var(--duration-fast);
}

.report-card:hover .report-card__arrow {
  color: var(--accent);
  transform: translateX(3px);
}


/* =============================================
   STATUS BADGES
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  white-space: nowrap;
}

/* Dot indicator */
.badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge--pending {
  color: var(--pending);
  background: rgba(168, 159, 148, 0.1);
  border: 1px solid rgba(168, 159, 148, 0.2);
}

.badge--pending::before {
  background: var(--pending);
}

.badge--running {
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(123, 104, 238, 0.2);
}

.badge--running::before {
  background: var(--accent);
  animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

.badge--completed {
  color: var(--success);
  background: rgba(80, 200, 120, 0.1);
  border: 1px solid rgba(80, 200, 120, 0.2);
}

.badge--completed::before {
  background: var(--success);
}

.badge--failed {
  color: var(--error);
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.2);
}

.badge--failed::before {
  background: var(--error);
}


/* =============================================
   REPORT VIEWER — Rendered Markdown Content
   ============================================= */
.report-viewer {
  padding-top: 6rem;
  min-height: 100vh;
}

.report-viewer__header {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.report-viewer__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  transition: color var(--duration-fast);
}

.report-viewer__back:hover {
  color: var(--accent);
}

.report-viewer__title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.report-viewer__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.report-viewer__meta-item {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.report-viewer__meta-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-light);
}

/* --- Markdown Content --- */
.report-content {
  max-width: 780px;
}

.report-content h1 {
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  color: var(--text-primary);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.report-content h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.7rem);
  color: var(--text-primary);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.report-content h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.report-content h4 {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.report-content p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.report-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(123, 104, 238, 0.3);
  transition: text-decoration-color var(--duration-fast);
}

.report-content a:hover {
  text-decoration-color: var(--accent);
  color: var(--text-primary);
}

.report-content ul,
.report-content ol {
  padding-left: 1.5rem;
  margin-bottom: var(--space-sm);
}

.report-content ul {
  list-style: disc;
}

.report-content ol {
  list-style: decimal;
}

.report-content li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 0.4rem;
}

.report-content li::marker {
  color: var(--accent);
}

.report-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.report-content em {
  font-style: italic;
  color: var(--text-secondary);
}

.report-content blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-md) 0;
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.report-content blockquote p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

.report-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: var(--space-lg) 0;
}

/* Inline code */
.report-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.88em;
  padding: 0.15rem 0.45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

/* Code blocks */
.report-content pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-md) 0;
  overflow-x: auto;
}

.report-content pre code {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
}

/* Tables */
.report-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: 0.92rem;
}

.report-content thead {
  border-bottom: 2px solid var(--border-light);
}

.report-content th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.report-content th:first-child {
  border-radius: var(--radius-sm) 0 0 0;
}

.report-content th:last-child {
  border-radius: 0 var(--radius-sm) 0 0;
}

.report-content td {
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.report-content tr:hover td {
  background: var(--bg-card);
}

/* Images within report content */
.report-content img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: var(--space-md) 0;
}


/* =============================================
   SUBMIT FORM
   ============================================= */
.submit-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.submit-form {
  max-width: 640px;
  margin: 0 auto;
}

.submit-form__heading {
  text-align: center;
  margin-bottom: var(--space-xs);
}

.submit-form__subtext {
  text-align: center;
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 auto var(--space-lg);
  max-width: 480px;
}

.submit-form__group {
  position: relative;
  margin-bottom: var(--space-md);
}

.submit-form__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.submit-form__input {
  width: 100%;
  padding: 0.9rem 1.25rem;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition:
    border-color var(--duration-fast),
    box-shadow var(--duration-fast),
    background var(--duration-fast);
}

.submit-form__input::placeholder {
  color: var(--text-muted);
}

.submit-form__input:focus {
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.submit-form__input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Textarea variant */
textarea.submit-form__input {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}

.submit-form__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  justify-content: center;
}

.submit-form__hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* --- Progress Indicator --- */
.progress {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.progress__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

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

.progress__percent {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.progress__bar {
  width: 100%;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width var(--duration-normal) var(--ease-out);
}

/* Indeterminate / animated progress */
.progress__fill--indeterminate {
  width: 30%;
  animation: progressSlide 1.5s ease-in-out infinite;
}

@keyframes progressSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.progress__steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.progress__step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.progress__step--done {
  color: var(--success);
}

.progress__step-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
}


/* =============================================
   FOOTER
   ============================================= */
.footer {
  padding: var(--space-lg) 0 var(--space-md);
}

.footer__rule {
  height: 1px;
  background: var(--border);
  margin-bottom: var(--space-lg);
}

.footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.footer__logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer__logo-icon {
  color: var(--accent);
  font-size: 0.65rem;
}

.footer__tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer__links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color var(--duration-fast);
}

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

.footer__copyright {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.6;
}

@media (max-width: 768px) {
  .footer__inner {
    flex-direction: column;
    gap: var(--space-md);
  }
}


/* =============================================
   LOADING SPINNER
   ============================================= */
.spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spinner__circle {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}

.spinner--sm .spinner__circle {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.spinner--lg .spinner__circle {
  width: 48px;
  height: 48px;
  border-width: 3px;
}

@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

/* Full-page loading state */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 60vh;
}

.loading-overlay__text {
  font-size: 0.9rem;
  color: var(--text-muted);
  animation: loadingFade 2s ease-in-out infinite;
}

@keyframes loadingFade {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}


/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
  max-width: 380px;
  transform: translateX(120%);
  opacity: 0;
  animation: toastIn var(--duration-normal) var(--ease-out) forwards;
}

.toast.toast--out {
  animation: toastOut var(--duration-fast) var(--ease-in-out) forwards;
}

@keyframes toastIn {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  margin-top: 1px;
}

.toast__body {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.toast__message {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.toast__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast), background var(--duration-fast);
}

.toast__close:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

/* Toast variants */
.toast--success {
  border-left: 3px solid var(--success);
}

.toast--success .toast__icon {
  color: var(--success);
}

.toast--error {
  border-left: 3px solid var(--error);
}

.toast--error .toast__icon {
  color: var(--error);
}

.toast--warning {
  border-left: 3px solid var(--warning);
}

.toast--warning .toast__icon {
  color: var(--warning);
}

.toast--info {
  border-left: 3px solid var(--accent);
}

.toast--info .toast__icon {
  color: var(--accent);
}


/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  min-height: 40vh;
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}

.empty-state__heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state__text {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 400px;
  margin-bottom: var(--space-md);
  line-height: 1.7;
}


/* =============================================
   FILTERS BAR
   ============================================= */
.filters {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.filters__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition:
    color var(--duration-fast),
    background var(--duration-fast),
    border-color var(--duration-fast);
}

.filters__chip:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: var(--bg-elevated);
}

.filters__chip--active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(123, 104, 238, 0.25);
}

.filters__chip--active:hover {
  color: var(--accent);
  background: rgba(123, 104, 238, 0.18);
}


/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: var(--space-lg);
}

.pagination__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition:
    color var(--duration-fast),
    background var(--duration-fast),
    border-color var(--duration-fast);
  cursor: pointer;
}

.pagination__btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border);
}

.pagination__btn--active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(123, 104, 238, 0.25);
}

.pagination__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination__ellipsis {
  width: 36px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
