/* ═══════════════════════════════════════════════════════════
   DEX Dashboard - Gold/Black Luxury Theme
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Color Variables */
:root {
  /* Background Colors */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-card-hover: #242424;
  
  /* Gold Colors */
  --gold-primary: #FFD700;
  --gold-secondary: #FFA500;
  --gold-dark: #B8860B;
  --gold-light: #FFEC8B;
  
  /* Text Colors */
  --text-primary: #FFFFFF;
  --text-secondary: #B8B8B8;
  --text-muted: #666666;
  
  /* Status Colors */
  --success: #10B981;
  --danger: #EF4444;
  --info: #3B82F6;
  
  /* Effects */
  --glow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
  --shadow-gold: 0 4px 20px rgba(255, 215, 0, 0.15);
  --border-gold: 1px solid var(--gold-primary);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
}

/* Particle Background */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--gold-primary);
  border-radius: 50%;
  animation: float 6s infinite;
  opacity: 0;
}

@keyframes float {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-20vh) scale(1);
    opacity: 0;
  }
}

/* Main Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header */
header {
  margin-bottom: 3rem;
  animation: fadeInDown 0.8s ease-out;
}

.header-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.header-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-left: 3.5rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: var(--border-gold);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-gold);
  transition: all 0.3s ease-in-out;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-primary), var(--gold-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--glow-gold);
  transform: translateY(-4px);
}

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

/* Metric Cards */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.metric-card:nth-child(1) { animation-delay: 0.1s; }
.metric-card:nth-child(2) { animation-delay: 0.2s; }
.metric-card:nth-child(3) { animation-delay: 0.3s; }
.metric-card:nth-child(4) { animation-delay: 0.4s; }

.metric-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-shadow: var(--glow-gold);
}

.metric-change {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.metric-change.positive {
  color: var(--success);
}

.metric-change.negative {
  color: var(--danger);
}

/* Chart Container */
.chart-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.chart-container {
  animation: fadeIn 0.8s ease-out;
  animation-delay: 0.5s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.chart-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--gold-primary);
}

/* Time Range Selector */
.time-range-selector {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 215, 0, 0.05);
  padding: 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.range-btn {
  background: transparent;
  border: 1px solid var(--gold-dark);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.range-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  transform: translateY(-2px);
}

.range-btn.active {
  background: var(--gold-primary);
  color: var(--bg-primary);
  border-color: var(--gold-primary);
  box-shadow: var(--glow-gold);
}

.chart-canvas {
  height: 300px;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  padding: 1rem;
}

/* Transactions Table */
.transactions-container {
  animation: fadeIn 1s ease-out;
  animation-delay: 0.6s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  text-align: left;
  padding: 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: rgba(255, 215, 0, 0.05);
}

tbody td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tx-type {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.tx-type.buy {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border: 1px solid var(--success);
}

.tx-type.sell {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.tx-hash {
  color: var(--gold-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.tx-hash:hover {
  color: var(--gold-light);
  text-shadow: var(--glow-gold);
}

/* Buttons */
.btn {
  background: var(--bg-card);
  border: var(--border-gold);
  color: var(--gold-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  background: var(--gold-primary);
  color: var(--bg-primary);
  box-shadow: var(--glow-gold);
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
  border: none;
  color: var(--bg-primary);
}

/* Loading Skeleton */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 215, 0, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
}

.skeleton-title,
.skeleton-value {
  background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}

.skeleton-title {
  height: 1rem;
  width: 40%;
  margin-bottom: 1rem;
}

.skeleton-value {
  height: 2rem;
  width: 60%;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Refresh Button */
.refresh-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
  border: none;
  border-radius: 50%;
  color: var(--bg-primary);
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.refresh-btn:hover {
  box-shadow: var(--glow-gold);
  transform: scale(1.1) rotate(180deg);
}

.refresh-btn.spinning {
  animation: spin 1s linear infinite;
}

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

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.status-badge.online {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border: 1px solid var(--success);
}

.status-badge.offline {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border: 1px solid var(--danger);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 3rem;
  border-top: 1px solid rgba(255, 215, 0, 0.1);
}

footer a {
  color: var(--gold-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--gold-light);
  text-shadow: var(--glow-gold);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .header-title {
    font-size: 1.75rem;
  }
  
  .metric-cards {
    grid-template-columns: 1fr;
  }
  
  .chart-section {
    grid-template-columns: 1fr;
  }
  
  .time-range-selector {
    flex-wrap: wrap;
  }
  
  .range-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: var(--border-gold);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  font-size: 0.875rem;
  z-index: 1000;
  box-shadow: var(--shadow-gold);
}

/* Gold Glow Effect */
.gold-glow {
  animation: pulse-gold 2s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  }
}

/* Loading State */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 215, 0, 0.3);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

