/**
 * SmartTrader Assets Page Styles
 * Asset data collection with dark theme and animations
 */

/* Layout */
.assets-container {
  min-height: 100vh;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  position: relative;
  overflow-x: hidden;
}

/* Animated Background */
.assets-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.assets-background__gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 85% 90%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.03) 0%, transparent 60%);
}

.assets-background__grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.5;
}

/* Header */
.assets-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
}

.assets-header__left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.assets-logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.assets-logo:hover {
  color: var(--color-accent-primary);
}

.assets-logo svg {
  width: 24px;
  height: 24px;
}

.assets-header__title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.assets-header__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Header Actions */
.header-actions {
  display: flex;
  gap: 0.75rem;
}

.btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn--icon svg {
  width: 16px;
  height: 16px;
}

/* Main Content */
.assets-main {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* Stats Overview */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition-normal);
  animation: fadeInUp 0.6s ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-hover);
  box-shadow:
    var(--shadow-lg),
    0 0 30px rgba(6, 182, 212, 0.1);
}

.stat-card--primary {
  border-left: 3px solid var(--color-accent-primary);
}

.stat-card--success {
  border-left: 3px solid #10b981;
}

.stat-card--info {
  border-left: 3px solid var(--color-accent-secondary);
}

.stat-card__icon {
  width: 48px;
  height: 48px;
  padding: 0.75rem;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 12px;
  color: var(--color-accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card__icon svg {
  width: 24px;
  height: 24px;
}

.stat-card__content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-card__value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
}

.stat-card__label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Assets Section */
.assets-section {
  margin-bottom: 3rem;
  animation: fadeInUp 0.6s ease-out both;
}

.assets-section:nth-child(3) { animation-delay: 0.3s; }
.assets-section:nth-child(4) { animation-delay: 0.35s; }

.assets-section__header {
  margin-bottom: 1.5rem;
}

.assets-section__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}

.assets-section__subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Assets Grid */
.assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.assets-grid--featured {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Asset Card */
.asset-card {
  position: relative;
  padding: 1.5rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition-normal);
  cursor: pointer;
  animation: fadeInUp 0.6s ease-out both;
}

.asset-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(6, 182, 212, 0.3),
    transparent
  );
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.asset-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-hover);
  box-shadow:
    var(--shadow-lg),
    0 0 30px rgba(6, 182, 212, 0.1);
}

.asset-card:hover::before {
  opacity: 1;
}

.asset-card--featured {
  background: linear-gradient(135deg,
    rgba(6, 182, 212, 0.05) 0%,
    rgba(17, 24, 39, 0.8) 100%
  );
  border-color: rgba(6, 182, 212, 0.3);
}

.asset-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.asset-card__icon {
  width: 40px;
  height: 40px;
  padding: 0.5rem;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 10px;
  color: var(--color-accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-card__icon svg {
  width: 20px;
  height: 20px;
}

.asset-card__type-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.asset-card__type-badge--crypto {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

.asset-card__type-badge--stock {
  background: rgba(6, 182, 212, 0.15);
  color: var(--color-accent-primary);
}

.asset-card__type-badge--forex {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.asset-card__type-badge--commodity {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.asset-card__symbol {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}

.asset-card__name {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

.asset-card__price {
  margin-bottom: 0.75rem;
}

.asset-card__price-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.asset-card__change {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.asset-card__change-value {
  font-size: 1rem;
  font-weight: 600;
}

.asset-card__change-value.positive {
  color: #10b981;
}

.asset-card__change-value.negative {
  color: #ef4444;
}

.asset-card__change-label {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
}

.asset-card__meta {
  display: flex;
  justify-content: space-between;
  padding-top: 0.75rem;
  margin-bottom: 1rem;
  border-top: 1px solid var(--color-border);
}

.asset-card__updated,
.asset-card__snapshots {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.asset-card__action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.asset-card:hover .asset-card__action {
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(6, 182, 212, 0.05);
  color: var(--color-accent-primary);
}

.asset-card__action svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.asset-card:hover .asset-card__action svg {
  transform: translateX(4px);
}

/* Empty State */
.assets-empty {
  text-align: center;
  padding: 4rem 2rem;
}

.assets-empty__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 20px;
  color: var(--color-accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.assets-empty__icon svg {
  width: 40px;
  height: 40px;
}

.assets-empty__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
}

.assets-empty__text {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

/* Loading & Error States */
.loading-state,
.empty-state,
.error-state {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  grid-column: 1 / -1;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 1rem;
  border: 2px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--color-accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: all var(--transition-normal);
}

.toast--hidden {
  transform: translateY(100px);
  opacity: 0;
}

.toast--visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--toast-color, var(--color-accent-primary));
}

.toast-message {
  font-size: 0.875rem;
  color: var(--color-text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent-gradient-start), var(--color-accent-gradient-end));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.btn-secondary:hover {
  border-color: var(--color-border-hover);
  background: rgba(31, 41, 55, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  color: var(--color-accent-primary);
  background: rgba(6, 182, 212, 0.1);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .assets-header {
    padding: 1rem;
  }

  .assets-header__title {
    font-size: 1.25rem;
  }

  .header-actions {
    flex-direction: column;
  }

  .assets-main {
    padding: 1rem;
  }

  .stats-overview {
    grid-template-columns: 1fr;
  }

  .assets-grid,
  .assets-grid--featured {
    grid-template-columns: 1fr;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

/* Pagination */
.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(6, 182, 212, 0.1);
}

.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination a {
  color: var(--color-text-secondary);
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.3);
}

.pagination a:hover {
  color: var(--color-accent);
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
}

.pagination .current {
  color: white;
  background: linear-gradient(135deg, #0891b2, #0e7490);
  border: 1px solid rgba(6, 182, 212, 0.5);
}

.pagination .disabled {
  color: var(--color-text-muted);
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(71, 85, 105, 0.2);
  cursor: not-allowed;
}

.pagination .gap {
  color: var(--color-text-muted);
  padding: 0.5rem 0.25rem;
}

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