/* market.css - Clean Version */
.market-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    font-family: 'Segoe UI', sans-serif;
    background: #fff;
}

/* Filter Section */
.asset-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.8rem 1.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: #000;
    color: white;
    border-color: #000;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Top Assets Grid */
.top-assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.asset-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 180px;
}

.asset-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #000 0%, #000 100%);
}

.asset-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.asset-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
}

.asset-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 10px;
    background: #f0f4f9;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.asset-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
}

.asset-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.asset-change {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.positive { color: #10b981; }
.negative { color: #ef4444; }

/* Chart Containers */
.card-chart-container {
    width: 120px;
    height: 50px;
    position: absolute;
    bottom: 15px;
    right: 15px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    background: none;
}

.asset-card:hover .card-chart-container {
    opacity: 1;
}

.chart-container {
    width: 120px;
    height: 40px;
    background: none;
}

.mkt-sparkline {
    width: 100% !important;
    height: 100% !important;
}

/* Market Table */
.market-table {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-top: 2rem;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 1.2rem 2rem;
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    border-bottom: 2px solid #f1f5f9;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 1.2rem 2rem;
    align-items: center;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f8f8f8;
}

.table-row:hover {
    background: #fafafa;
}

.asset-name-cell {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 0 1rem;
}

.page-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #444;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.page-btn.active {
    background: #000;
    color: white;
    border-color: #000;
}

.page-btn:hover {
    background: #f8f8f8;
}

/* Mobile Responsive Table */
@media (max-width: 768px) {
    .market-table {
      border-radius: 12px;
      overflow-x: auto;
    }
  
    .table-header {
      display: none;
    }
  
    .table-row {
      grid-template-columns: 1fr;
      padding: 1rem;
      position: relative;
      border-bottom: 2px solid #eee;
      gap: 0.5rem;
    }
  
    .table-row > div {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.5rem 0;
    }
  
    .table-row > div::before {
      content: attr(data-label);
      color: #888;
      font-weight: 500;
      margin-right: 1rem;
      flex-shrink: 0;
      width: 35%; /* Fixed label width */
    }
  
    .asset-name-cell {
      grid-column: 1 / -1;
      padding-bottom: 0.5rem;
      border-bottom: 1px solid #eee;
      margin-bottom: 0.5rem;
    }
  
    .asset-name-cell::before {
      display: none;
    }
  
    .chart-container {
      width: 120px;
      height: 40px;
      flex-grow: 1; /* Take remaining space */
    }
  
    /* Specific column adjustments */
    .table-row > div:nth-child(2) { /* 24h % */
      order: 2;
    }
  
    .table-row > div:nth-child(3) { /* Chart */
      order: 3;
      align-items: flex-start; /* Better chart alignment */
    }
  
    .table-row > div:nth-child(4) { /* Price */
      order: 4;
      font-weight: 600;
    }
  
    /* Data labels */
    .table-row > div:nth-child(2)::before { content: '24h Change'; }
    .table-row > div:nth-child(3)::before { content: 'Trend'; }
    .table-row > div:nth-child(4)::before { content: 'Price'; }
  
    /* Chart canvas sizing */
    .mkt-sparkline {
      width: 100% !important;
      height: 100% !important;
    }
  }
  
  @media (max-width: 480px) {
    .table-row {
      padding: 0.75rem;
      gap: 0.25rem;
    }
  
    .table-row > div::before {
      width: 40%; /* More space for labels */
      font-size: 0.85rem;
    }
  
    .asset-icon {
      width: 36px;
      height: 36px;
    }
  
    .chart-container {
      width: 100px;
      height: 35px;
    }
  
    .table-row > div {
      font-size: 0.9rem;
      padding: 0.3rem 0;
    }
  }

  

  /* wrapper must be position:relative */
.loader-wrapper {
  position: relative;
}
/* the overlay covers entire wrapper */
.loader-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;              /* hidden by default */
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.7);
  z-index: 10;
}
/* the spinning circle */
.loader-overlay .spinner {
  border: 4px solid #eee;
  border-top: 4px solid #333;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
}
/* spin animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}
