/**
 * 999DEX CATEGORY SYSTEM - Styles
 *
 * Provides comprehensive styling for the category system including:
 * - Category headers with gradients and icons
 * - Category badges for token cards
 * - Empty states
 * - Category-specific color schemes
 *
 * Version: 1.0.0
 * Date: November 2, 2025
 * Agent: 21 - Category System Implementation
 */

/* ========================================
   CATEGORY COLOR VARIABLES
   ======================================== */

:root {
  /* Meme Coins - Pink/Purple */
  --category-meme-primary: #ff6ec7;
  --category-meme-secondary: #c026d3;
  --category-meme-bg: rgba(255, 110, 199, 0.1);
  --category-meme-border: rgba(255, 110, 199, 0.3);

  /* Gaming - Blue/Cyan */
  --category-gaming-primary: #3b82f6;
  --category-gaming-secondary: #06b6d4;
  --category-gaming-bg: rgba(59, 130, 246, 0.1);
  --category-gaming-border: rgba(59, 130, 246, 0.3);

  /* DeFi - Green/Emerald */
  --category-defi-primary: #10b981;
  --category-defi-secondary: #059669;
  --category-defi-bg: rgba(16, 185, 129, 0.1);
  --category-defi-border: rgba(16, 185, 129, 0.3);

  /* NFT - Orange/Amber */
  --category-nft-primary: #f59e0b;
  --category-nft-secondary: #d97706;
  --category-nft-bg: rgba(245, 158, 11, 0.1);
  --category-nft-border: rgba(245, 158, 11, 0.3);

  /* Community - Violet/Purple */
  --category-community-primary: #8b5cf6;
  --category-community-secondary: #7c3aed;
  --category-community-bg: rgba(139, 92, 246, 0.1);
  --category-community-border: rgba(139, 92, 246, 0.3);
}

/* ========================================
   CATEGORY HEADER
   ======================================== */

.category-header {
  position: relative;
  padding: var(--spacing-3xl) var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-primary);
}

.category-header::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  z-index: 0;
  background: linear-gradient(135deg,
    var(--category-color-primary, #8b5cf6) 0%,
    var(--category-color-secondary, #7c3aed) 100%);
}

.category-header__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.category-header__icon {
  font-size: var(--font-size-4xl);
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.category-header__text {
  flex: 1;
}

.category-header__title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-extrabold);
  margin-bottom: var(--spacing-sm);
  background: linear-gradient(
    135deg,
    var(--category-color-primary, var(--accent-purple)),
    var(--category-color-secondary, #7c3aed)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: var(--line-height-tight);
}

.category-header__description {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

.category-header__stats {
  display: flex;
  gap: var(--spacing-xl);
  margin-top: var(--spacing-lg);
}

.category-header__stat {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.category-header__stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  font-weight: var(--font-weight-medium);
}

.category-header__stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.category-header__actions {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.category-header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  height: var(--button-height-md);
  padding: 0 var(--button-padding-x);
  border-radius: var(--button-radius);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  transition: var(--transition-all-normal);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.category-header__btn--primary {
  background: linear-gradient(
    135deg,
    var(--category-color-primary, #8b5cf6),
    var(--category-color-secondary, #7c3aed)
  );
  color: white;
}

.category-header__btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.category-header__btn--secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.category-header__btn--secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ========================================
   CATEGORY BADGES
   ======================================== */

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--category-bg);
  color: var(--category-color-primary);
  border: 1px solid var(--category-border);
  transition: var(--transition-all-normal);
}

.category-badge:hover {
  background: var(--category-color-primary);
  color: white;
  border-color: var(--category-color-primary);
}

.category-badge__icon {
  font-size: var(--font-size-sm);
  line-height: 1;
}

/* Category-specific badge styles */
.category-badge--meme {
  --category-bg: var(--category-meme-bg);
  --category-color-primary: var(--category-meme-primary);
  --category-border: var(--category-meme-border);
}

.category-badge--gaming {
  --category-bg: var(--category-gaming-bg);
  --category-color-primary: var(--category-gaming-primary);
  --category-border: var(--category-gaming-border);
}

.category-badge--defi {
  --category-bg: var(--category-defi-bg);
  --category-color-primary: var(--category-defi-primary);
  --category-border: var(--category-defi-border);
}

.category-badge--nft {
  --category-bg: var(--category-nft-bg);
  --category-color-primary: var(--category-nft-primary);
  --category-border: var(--category-nft-border);
}

.category-badge--community {
  --category-bg: var(--category-community-bg);
  --category-color-primary: var(--category-community-primary);
  --category-border: var(--category-community-border);
}

/* Token card badge position */
.token-card__category-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.category-empty {
  grid-column: 1 / -1;
  padding: 4rem 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.category-empty__icon {
  font-size: 64px;
  margin-bottom: 1.5rem;
  opacity: 0.3;
  filter: grayscale(1);
}

.category-empty__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
}

.category-empty__description {
  font-size: var(--font-size-base);
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.category-empty__actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

.category-empty__btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  transition: var(--transition-all-normal);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
}

.category-empty__btn--primary {
  background: linear-gradient(
    135deg,
    var(--category-color-primary, #8b5cf6),
    var(--category-color-secondary, #7c3aed)
  );
  color: white;
  border: none;
}

.category-empty__btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.category-empty__btn--secondary {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-empty__btn--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.category-empty__suggestions {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.category-empty__suggestions-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-empty__category-links {
  display: flex;
  gap: var(--spacing-base);
  justify-content: center;
  flex-wrap: wrap;
}

.category-empty__category-link {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  text-decoration: none;
  transition: var(--transition-all-normal);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.category-empty__category-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* ========================================
   CATEGORY SELECTOR (for create.html)
   ======================================== */

.category-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--spacing-base);
}

.category-selector__option {
  position: relative;
  cursor: pointer;
}

.category-selector__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-selector__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 1.25rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition-all-normal);
  cursor: pointer;
  min-height: 100px;
  justify-content: center;
}

.category-selector__input:checked + .category-selector__label {
  background: var(--category-bg);
  border-color: var(--category-color-primary);
  box-shadow: 0 0 0 3px rgba(var(--category-color-primary-rgb), 0.2);
}

.category-selector__label:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.category-selector__icon {
  font-size: 32px;
  line-height: 1;
}

.category-selector__name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  color: white;
}

/* Category-specific selector colors */
.category-selector__option--meme .category-selector__input:checked + .category-selector__label {
  --category-bg: var(--category-meme-bg);
  --category-color-primary: var(--category-meme-primary);
  --category-color-primary-rgb: 255, 110, 199;
}

.category-selector__option--gaming .category-selector__input:checked + .category-selector__label {
  --category-bg: var(--category-gaming-bg);
  --category-color-primary: var(--category-gaming-primary);
  --category-color-primary-rgb: 59, 130, 246;
}

.category-selector__option--defi .category-selector__input:checked + .category-selector__label {
  --category-bg: var(--category-defi-bg);
  --category-color-primary: var(--category-defi-primary);
  --category-color-primary-rgb: 16, 185, 129;
}

.category-selector__option--nft .category-selector__input:checked + .category-selector__label {
  --category-bg: var(--category-nft-bg);
  --category-color-primary: var(--category-nft-primary);
  --category-color-primary-rgb: 245, 158, 11;
}

.category-selector__option--community .category-selector__input:checked + .category-selector__label {
  --category-bg: var(--category-community-bg);
  --category-color-primary: var(--category-community-primary);
  --category-color-primary-rgb: 139, 92, 246;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .category-header {
    padding: 2rem 1.5rem;
  }

  .category-header__content {
    flex-direction: column;
    text-align: center;
  }

  .category-header__icon {
    font-size: 48px;
  }

  .category-header__title {
    font-size: 32px;
  }

  .category-header__description {
    font-size: var(--font-size-base);
  }

  .category-header__stats {
    justify-content: center;
    gap: 1.5rem;
  }

  .category-header__actions {
    flex-direction: column;
    width: 100%;
  }

  .category-header__btn {
    width: 100%;
    justify-content: center;
  }

  .category-empty {
    padding: 3rem 1.5rem;
  }

  .category-empty__icon {
    font-size: 48px;
  }

  .category-empty__title {
    font-size: var(--font-size-xl);
  }

  .category-empty__description {
    font-size: var(--font-size-base);
  }

  .category-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .category-header__stats {
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: center;
  }

  .category-empty__actions {
    flex-direction: column;
  }

  .category-empty__btn {
    width: 100%;
    justify-content: center;
  }

  .category-empty__category-links {
    flex-direction: column;
  }

  .category-selector {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes category-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-header {
  animation: category-fade-in 600ms ease-out;
}

.category-badge {
  animation: category-fade-in 400ms ease-out;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.category-selector__input:focus-visible + .category-selector__label {
  outline: 2px solid white;
  outline-offset: 2px;
}

.category-badge:focus-visible,
.category-empty__btn:focus-visible,
.category-header__btn:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .category-badge,
  .category-selector__label,
  .category-empty {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .category-header,
  .category-badge,
  .category-badge:hover,
  .category-header__btn:hover,
  .category-empty__btn:hover {
    animation: none;
    transform: none;
    transition: none;
  }
}
