/* 
 * ═══════════════════════════════════════════════════════════════
 * MODERN COINS PAGE STYLES - Next-Generation Coin List UI
 * ═══════════════════════════════════════════════════════════════
 * Features:
 * - Advanced theme integration
 * - Modern coin cards with glassmorphism
 * - Interactive table design
 * - Smooth animations
 * - Responsive layout
 * - Theme-aware styling
 */

/* ═══════════════════════════════════════════════════════════════
   COINS PAGE HERO SECTION
═══════════════════════════════════════════════════════════════ */

.coins-hero {
  position: relative;
  padding: 3rem 2rem;
  background: var(--theme-bg-primary);
  overflow: hidden;
}

.coins-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(34, 211, 238, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(244, 63, 94, 0.06) 0%, transparent 50%);
  animation: coinsHeroGradient 15s ease-in-out infinite;
  pointer-events: none;
}

@keyframes coinsHeroGradient {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(2%, 2%) rotate(1deg);
  }
  66% {
    transform: translate(-1%, 1%) rotate(-1deg);
  }
}

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

.coins-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: var(--theme-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  animation: coinsHeroFadeIn 0.8s ease-out;
}

@keyframes coinsHeroFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.coins-hero-subtitle {
  font-size: 1.125rem;
  color: var(--theme-text-secondary);
  margin-bottom: 2rem;
  animation: coinsHeroFadeIn 0.8s ease-out 0.2s both;
}

/* ═══════════════════════════════════════════════════════════════
   ADVANCED FILTERS SECTION
═══════════════════════════════════════════════════════════════ */

.coins-filters {
  background: var(--theme-glass-bg);
  backdrop-filter: blur(var(--theme-glass-blur));
  border: 1px solid var(--theme-border-1);
  border-radius: var(--theme-radius-2xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
  animation: coinsHeroFadeIn 0.8s ease-out 0.4s both;
}

.coins-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.coins-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.coins-filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--theme-text-secondary);
}

.coins-filter-input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--theme-border-2);
  border-radius: var(--theme-radius-lg);
  background: var(--theme-surface-1);
  color: var(--theme-text-primary);
  font-size: 0.875rem;
  transition: all var(--theme-transition-base);
}

.coins-filter-input:focus {
  outline: none;
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.coins-filter-select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--theme-border-2);
  border-radius: var(--theme-radius-lg);
  background: var(--theme-surface-1);
  color: var(--theme-text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--theme-transition-base);
}

.coins-filter-select:focus {
  outline: none;
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.coins-filter-button {
  padding: 0.75rem 1.5rem;
  background: var(--theme-gradient-primary);
  color: white;
  border: none;
  border-radius: var(--theme-radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--theme-transition-base);
}

.coins-filter-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--theme-shadow-lg);
}

.coins-filter-button-secondary {
  background: var(--theme-surface-2);
  color: var(--theme-text-primary);
  border: 2px solid var(--theme-border-2);
}

.coins-filter-button-secondary:hover {
  background: var(--theme-surface-3);
  border-color: var(--theme-border-3);
}

/* ═══════════════════════════════════════════════════════════════
   MODERN COIN TABLE
═══════════════════════════════════════════════════════════════ */

.coins-table-container {
  background: var(--theme-glass-bg);
  backdrop-filter: blur(var(--theme-glass-blur));
  border: 1px solid var(--theme-border-1);
  border-radius: var(--theme-radius-2xl);
  overflow: hidden;
  box-shadow: var(--theme-shadow-lg);
  animation: coinsHeroFadeIn 0.8s ease-out 0.6s both;
}

.coins-table-modern {
  width: 100%;
  border-collapse: collapse;
}

.coins-table-modern thead {
  background: var(--theme-surface-2);
  border-bottom: 2px solid var(--theme-border-2);
}

.coins-table-modern th {
  padding: 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--theme-text-tertiary);
  cursor: pointer;
  transition: color var(--theme-transition-fast);
  white-space: nowrap;
}

.coins-table-modern th:hover {
  color: var(--theme-primary);
}

.coins-table-modern th.sortable {
  position: relative;
}

.coins-table-modern th.sortable::after {
  content: '↕';
  margin-left: 0.5rem;
  opacity: 0.3;
}

.coins-table-modern th.sort-asc::after {
  content: '↑';
  opacity: 1;
  color: var(--theme-primary);
}

.coins-table-modern th.sort-desc::after {
  content: '↓';
  opacity: 1;
  color: var(--theme-primary);
}

.coins-table-modern tbody tr {
  border-bottom: 1px solid var(--theme-border-1);
  transition: all var(--theme-transition-base);
}

.coins-table-modern tbody tr:hover {
  background: var(--theme-surface-2);
  transform: scale(1.01);
}

.coins-table-modern tbody tr:last-child {
  border-bottom: none;
}

.coins-table-modern td {
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--theme-text-primary);
  vertical-align: middle;
}

/* Coin Cell */
.coin-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.coin-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--theme-radius-lg);
  overflow: hidden;
  background: var(--theme-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--theme-text-secondary);
  flex-shrink: 0;
}

.coin-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.coin-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.coin-name {
  font-weight: 600;
  color: var(--theme-text-primary);
}

.coin-symbol {
  font-size: 0.75rem;
  color: var(--theme-text-tertiary);
  font-weight: 500;
}

/* Price Cell */
.price-cell {
  font-family: var(--theme-font-mono);
  font-weight: 600;
  color: var(--theme-text-primary);
}

.price-change {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--theme-radius-full);
  font-weight: 600;
}

.price-change.positive {
  background: rgba(16, 185, 129, 0.1);
  color: var(--theme-success);
}

.price-change.negative {
  background: rgba(239, 68, 68, 0.1);
  color: var(--theme-danger);
}

/* Chart Cell */
.chart-cell {
  width: 120px;
  height: 40px;
}

.chart-placeholder {
  width: 100%;
  height: 100%;
  background: var(--theme-surface-3);
  border-radius: var(--theme-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-text-muted);
  font-size: 0.75rem;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.action-button {
  padding: 0.5rem 0.75rem;
  border-radius: var(--theme-radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--theme-transition-fast);
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.action-button-primary {
  background: var(--theme-gradient-primary);
  color: white;
}

.action-button-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--theme-shadow-md);
}

.action-button-secondary {
  background: var(--theme-surface-2);
  color: var(--theme-text-primary);
  border: 1px solid var(--theme-border-2);
}

.action-button-secondary:hover {
  background: var(--theme-surface-3);
  border-color: var(--theme-border-3);
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE COIN CARDS
═══════════════════════════════════════════════════════════════ */

.coin-card-mobile {
  background: var(--theme-glass-bg);
  backdrop-filter: blur(var(--theme-glass-blur));
  border: 1px solid var(--theme-border-1);
  border-radius: var(--theme-radius-xl);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all var(--theme-transition-base);
  cursor: pointer;
}

.coin-card-mobile:hover {
  transform: translateY(-2px);
  box-shadow: var(--theme-shadow-lg);
  border-color: var(--theme-border-2);
}

.coin-card-mobile-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.coin-card-mobile-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.coin-card-mobile-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.coin-card-mobile-label {
  font-size: 0.75rem;
  color: var(--theme-text-tertiary);
  font-weight: 500;
}

.coin-card-mobile-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--theme-text-primary);
}

.coin-card-mobile-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   BADGES AND TAGS
═══════════════════════════════════════════════════════════════ */

.coin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--theme-radius-full);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.coin-badge-boost {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.coin-badge-new {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.coin-badge-verified {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════════════ */

.coins-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem;
  flex-wrap: wrap;
}

.pagination-button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--theme-border-2);
  border-radius: var(--theme-radius-lg);
  background: var(--theme-surface-1);
  color: var(--theme-text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--theme-transition-fast);
  min-width: 40px;
}

.pagination-button:hover:not(:disabled) {
  background: var(--theme-surface-2);
  border-color: var(--theme-border-3);
  transform: translateY(-1px);
}

.pagination-button.active {
  background: var(--theme-gradient-primary);
  color: white;
  border-color: transparent;
}

.pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  padding: 0 1rem;
  font-size: 0.875rem;
  color: var(--theme-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   LOADING STATES
═══════════════════════════════════════════════════════════════ */

.coins-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 1rem;
}

.coins-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--theme-border-2);
  border-top-color: var(--theme-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.coins-loading-text {
  font-size: 1rem;
  color: var(--theme-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════════ */

.coins-empty {
  text-align: center;
  padding: 4rem 2rem;
}

.coins-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.coins-empty-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--theme-text-primary);
  margin-bottom: 0.5rem;
}

.coins-empty-description {
  font-size: 1rem;
  color: var(--theme-text-secondary);
  margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .coins-hero {
    padding: 2rem 1rem;
  }
  
  .coins-filters {
    padding: 1rem;
  }
  
  .coins-filters-grid {
    grid-template-columns: 1fr;
  }
  
  .coins-table-container {
    border-radius: var(--theme-radius-xl);
  }
  
  .coins-table-modern th,
  .coins-table-modern td {
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .coin-logo {
    width: 32px;
    height: 32px;
  }
  
  .chart-cell {
    width: 80px;
    height: 32px;
  }
  
  .action-button {
    padding: 0.375rem 0.5rem;
    font-size: 0.625rem;
  }
  
  .coins-pagination {
    padding: 1rem;
  }
  
  .pagination-button {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    min-width: 32px;
  }
}

@media (max-width: 480px) {
  .coins-hero-title {
    font-size: 1.75rem;
  }
  
  .coins-hero-subtitle {
    font-size: 1rem;
  }
  
  .coin-card-mobile {
    padding: 0.75rem;
  }
  
  .coin-card-mobile-body {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   THEME TRANSITIONS
═══════════════════════════════════════════════════════════════ */

.coins-table-modern,
.coin-card-mobile,
.coins-filters,
.coins-pagination {
  transition: background-color var(--theme-transition-base),
              border-color var(--theme-transition-base),
              color var(--theme-transition-base);
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY
═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .coins-table-modern tbody tr:hover,
  .coin-card-mobile:hover,
  .action-button:hover,
  .pagination-button:hover {
    transform: none;
  }
  
  .coins-hero::before {
    animation: none;
  }
}

/* Focus states for keyboard navigation */
.coins-filter-input:focus,
.coins-filter-select:focus,
.action-button:focus,
.pagination-button:focus {
  outline: 2px solid var(--theme-primary);
  outline-offset: 2px;
}
