:root {
    /* Light theme colors */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef2ff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --accent-primary: #4f46e5;
    --accent-secondary: #6366f1;
    --border-color: #e2e8f0;
    --positive: #10b981;
    --negative: #ef4444;
    --chart-grid: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.03), 0 4px 6px rgba(0, 0, 0, 0.05);
  }
  
  .dark-theme {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --accent-primary: #818cf8;
    --accent-secondary: #a5b4fc;
    --border-color: #334155;
    --positive: #34d399;
    --negative: #f87171;
    --chart-grid: #334155;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.20), 0 4px 6px rgba(0, 0, 0, 0.22);
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: 'Prompt', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
  }
  
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
  }
  
  /* Header */
  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
  }
  
  .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-primary);
  }
  
  .logo i {
    font-size: 1.8rem;
  }
  
  .logo h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
  }
  
  .theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: color 0.3s;
  }
  
  .theme-toggle:hover {
    color: var(--accent-primary);
  }
  
  /* Market Info Section */
  .market-info {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    background-color: var(--bg-secondary);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
  }
  
  .market-item {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px;
  }
  
  .market-item .label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 4px;
  }
  
  .market-item .value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
  }
  
  /* Search and Filters */
  .controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 15px;
  }
  
  .search-box {
    flex: 1;
    position: relative;
  }
  
  .search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
  }
  
  .search-box input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s;
  }
  
  .search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
  }
  
  .currency-selector select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.3s;
  }
  
  .currency-selector select:focus {
    outline: none;
    border-color: var(--accent-primary);
  }
  
  /* Tabs */
  .tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .tab {
    padding: 8px 16px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
    position: relative;
  }
  
  .tab:hover {
    color: var(--accent-primary);
  }
  
  .tab.active {
    color: var(--accent-primary);
    font-weight: 500;
  }
  
  .tab.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 2px;
    background-color: var(--accent-primary);
  }
  
  /* Crypto Table */
  .table-container {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
  }
  
  .crypto-table {
    width: 100%;
    border-collapse: collapse;
  }
  
  .crypto-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 500;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .crypto-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.95rem;
  }
  
  .crypto-table tr:last-child td {
    border-bottom: none;
  }
  
  .crypto-table tr:hover {
    background-color: var(--bg-tertiary);
    cursor: pointer;
  }
  
  .coin-info-cell {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .coin-logo {
    width: 28px;
    height: 28px;
  }
  
  .coin-name {
    font-weight: 500;
  }
  
  .coin-symbol {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-transform: uppercase;
  }
  
  .price-change {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    width: fit-content;
  }
  
  .positive {
    color: var(--positive);
  }
  
  .negative {
    color: var(--negative);
  }
  
  .favorite-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
  }
  
  .favorite-btn:hover, .favorite-btn.active {
    color: gold;
  }
  
  /* Pagination */
  .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 2rem;
  }
  
  .pagination button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
  }
  
  .pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .pagination button:not(:disabled):hover {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-primary);
  }
  
  #page-indicator {
    color: var(--text-secondary);
  }
  
  /* Loading Spinner */
  .loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
  }
  
  .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
  }
  
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  
  /* Modal */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
  }
  
  .modal-content {
    background-color: var(--bg-secondary);
    margin: 2rem auto;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
  }
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .coin-info {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  #modal-coin-img {
    width: 36px;
    height: 36px;
  }
  
  #modal-coin-name {
    font-size: 1.4rem;
    margin: 0;
    font-weight: 600;
  }
  
  #modal-coin-symbol {
    font-size: 1rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
  }
  
  .close-modal {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.3s;
  }
  
  .close-modal:hover {
    color: var(--accent-primary);
  }
  
  .price-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  #modal-coin-price {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
  }
  
  .change {
    font-size: 1rem;
    font-weight: 500;
  }
  
  .chart-container {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
  }
  
  .chart-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
  }
  
  .chart-period {
    display: flex;
    gap: 8px;
  }
  
  .period-btn {
    padding: 5px 10px;
    border-radius: 4px;
    background-color: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.3s;
  }
  
  .period-btn:hover, .period-btn.active {
    background-color: var(--accent-primary);
    color: white;
  }
  
  #price-chart {
    width: 100%;
    height: 300px;
  }
  
  .coin-stats {
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .stat-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .stat-item {
    display: flex;
    flex-direction: column;
  }
  
  .stat-label {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-bottom: 4px;
  }
  
  .stat-value {
    font-size: 1rem;
    font-weight: 500;
  }
  
  .coin-description {
    padding: 1.5rem;
  }
  
  .coin-description h3 {
    margin-bottom: 1rem;
    font-weight: 600;
  }
  
  .coin-description p {
    color: var(--text-secondary);
    line-height: 1.7;
  }
  
  /* Footer */
  footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-tertiary);
    font-size: 0.9rem;
  }
  
  footer a {
    color: var(--accent-primary);
    text-decoration: none;
  }
  
  footer a:hover {
    text-decoration: underline;
  }
  
  /* Responsive Design */
  @media (max-width: 1024px) {
    .container {
      padding: 1rem;
    }
    
    .crypto-table th, .crypto-table td {
      padding: 0.8rem;
    }
  }
  
  @media (max-width: 768px) {
    .crypto-table th:nth-child(5),
    .crypto-table td:nth-child(5),
    .crypto-table th:nth-child(7),
    .crypto-table td:nth-child(7) {
      display: none;
    }
    
    .market-info {
      flex-direction: column;
    }
    
    .modal-content {
      margin: 1rem;
    }
  }
  
  @media (max-width: 576px) {
    .crypto-table th:nth-child(4),
    .crypto-table td:nth-child(4),
    .crypto-table th:nth-child(6),
    .crypto-table td:nth-child(6) {
      display: none;
    }
    
    .controls {
      flex-direction: column;
    }
    
    .tabs {
      overflow-x: auto;
      white-space: nowrap;
      padding-bottom: 5px;
    }
    
    .coin-stats {
      flex-direction: column;
      gap: 1.5rem;
    }
  }