* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
  color: white;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.last-updated {
  font-size: 0.9rem;
  opacity: 0.9;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: #667eea;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: #5a6fd8;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.auto-refresh label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-card h3 {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

.crypto-table-container {
  background: white;
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: visible;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.crypto-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 900px;
}

.crypto-table th {
  background: #f8f9fa;
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  color: #666;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.9rem;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.crypto-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.9rem;
  vertical-align: middle;
}

/* Column-specific widths */
.crypto-table th:first-child,
.crypto-table td:first-child {
  width: 60px;
  text-align: center;
}

.crypto-table th:nth-child(2),
.crypto-table td:nth-child(2) {
  width: 140px;
}

.crypto-table th:nth-child(3),
.crypto-table td:nth-child(3) {
  width: 100px;
  text-align: right;
}

.crypto-table th:nth-child(4),
.crypto-table td:nth-child(4),
.crypto-table th:nth-child(5),
.crypto-table td:nth-child(5),
.crypto-table th:nth-child(6),
.crypto-table td:nth-child(6) {
  width: 90px;
  text-align: right;
}

.crypto-table th:nth-child(7),
.crypto-table td:nth-child(7),
.crypto-table th:nth-child(8),
.crypto-table td:nth-child(8) {
  width: 110px;
  text-align: right;
}

.crypto-table tbody tr:hover {
  background: #f8f9fa;
}

.crypto-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crypto-name strong {
  font-size: 0.95rem;
  line-height: 1.2;
}

.crypto-symbol {
  color: #666;
  font-size: 0.8rem;
  font-weight: 500;
}

.price-change {
  font-weight: 600;
}

.positive {
  color: #28a745;
}

.negative {
  color: #dc3545;
}

.loading {
  text-align: center;
  color: #666;
  font-style: italic;
}

.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 5px;
  margin-top: 20px;
  text-align: center;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 15px;
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px;
  border-bottom: 1px solid #eee;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 15px 15px 0 0;
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Custom scrollbar for modal */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.coin-details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.detail-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #e9ecef;
  transition: transform 0.2s ease;
}

.detail-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detail-card h4 {
  margin: 0 0 12px 0;
  color: #666;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.detail-value {
  font-size: 1.4rem;
  font-weight: bold;
  color: #333;
  line-height: 1.2;
}

.price-changes {
  margin-bottom: 25px;
}

.price-changes h4 {
  margin-bottom: 15px;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 8px;
}

.changes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
}

.change-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 18px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 10px;
  border: 1px solid #e9ecef;
  transition: transform 0.2s ease;
}

.change-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.change-value {
  font-weight: bold;
}

.additional-info h4 {
  margin-bottom: 15px;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 8px;
}

.info-grid {
  display: grid;
  gap: 10px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 18px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 10px;
  border: 1px solid #e9ecef;
}

.info-item span:first-child {
  font-weight: 600;
  color: #666;
}

/* Chart Styles */
.chart-section {
  margin-bottom: 25px;
}

.chart-section h4 {
  margin-bottom: 15px;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 8px;
}

.chart-container {
  position: relative;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e9ecef;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-loading {
  color: #666;
  font-style: italic;
}

#priceChart {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  header h1 {
    font-size: 2rem;
  }

  .controls {
    flex-direction: column;
    gap: 15px;
  }

  .crypto-table {
    font-size: 0.9rem;
  }

  .crypto-table {
    font-size: 0.8rem;
  }

  .crypto-table th,
  .crypto-table td {
    padding: 8px 4px;
  }

  .crypto-name strong {
    font-size: 0.85rem;
  }

  .crypto-symbol {
    font-size: 0.75rem;
  }

  .modal-content {
    margin: 10px;
    max-height: 95vh;
    max-width: 95vw;
  }

  .coin-details-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px;
  }

  .changes-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .change-item {
    padding: 12px 15px;
  }

  .detail-card {
    padding: 15px;
  }

  .detail-value {
    font-size: 1.2rem;
  }
}

/* Enhanced table styles for additional data */
.crypto-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
}

.crypto-name {
  display: flex;
  align-items: center;
}

.name-info {
  display: flex;
  flex-direction: column;
}

.rank-badge {
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  color: #666;
}

.price-cell {
  text-align: right;
}

.price-main {
  font-weight: bold;
  font-size: 1rem;
}

.price-change-abs {
  font-size: 0.8rem;
  margin-top: 2px;
}

.volume-main {
  font-weight: bold;
}

.volume-ratio {
  font-size: 0.8rem;
  color: #666;
  margin-top: 2px;
}

.ath-cell {
  text-align: right;
}

.ath-price {
  font-weight: bold;
}

.ath-change {
  font-size: 0.8rem;
  margin-top: 2px;
}

.supply-cell {
  text-align: right;
}

.supply-main {
  font-weight: bold;
}

.supply-max {
  font-size: 0.8rem;
  color: #666;
  margin-top: 2px;
}

/* Table header alignment classes */
.text-left {
  text-align: left !important;
}

.text-center {
  text-align: center !important;
}

.text-right {
  text-align: right !important;
}

/* Ensure consistent alignment for table headers and cells */
.crypto-table th {
  text-align: left; /* Default alignment */
}

.crypto-table th.text-center {
  text-align: center;
}

.crypto-table th.text-right {
  text-align: right;
}

/* Also align percentage change columns to center */
.crypto-table td.price-change {
  text-align: center;
}

/* Enhanced modal styles */
.supply-info,
.ath-atl-info,
.market-stats {
  margin-bottom: 25px;
}

.records-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 10px;
}

.record-card {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
}

.ath-card {
  border-left: 4px solid #28a745;
}

.atl-card {
  border-left: 4px solid #dc3545;
}

.record-label {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 5px;
}

.record-price {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.record-change {
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.record-date {
  font-size: 0.8rem;
  color: #666;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.stat-item:last-child {
  border-bottom: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .crypto-table th:nth-child(n + 6),
  .crypto-table td:nth-child(n + 6) {
    display: none;
  }

  .records-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .crypto-table th:nth-child(n + 4),
  .crypto-table td:nth-child(n + 4) {
    display: none;
  }
} /* Sparklin
e styles */
.sparkline-container {
  margin-top: 5px;
  display: flex;
  justify-content: center;
}

.sparkline {
  opacity: 0.8;
}

.sparkline-placeholder {
  font-size: 0.8rem;
  color: #999;
  text-align: center;
  padding: 5px 0;
} /* E
nhanced settings page styles */
.settings-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.checkbox-item {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.checkbox-item:hover {
  background: #e9ecef;
  border-color: #667eea;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  transform: scale(1.2);
}

.checkbox-item label {
  margin: 0;
  cursor: pointer;
  font-weight: 500;
}

.form-group select {
  background: white;
  cursor: pointer;
}

.form-group select:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Table style preview indicators */
.table-style-info {
  font-size: 0.9rem;
  color: #666;
  margin-top: 5px;
  font-style: italic;
}

@media (max-width: 768px) {
  .checkbox-group {
    grid-template-columns: 1fr;
  }

  .settings-section {
    padding: 20px;
  }
}

/* Compact layout improvements */
.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.compact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.compact-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.compact-label {
  font-weight: 600;
  color: #555;
  margin-right: 10px;
  font-size: 0.85rem;
}

.compact-item span:last-child {
  font-weight: 500;
  color: #333;
}

/* Modal section spacing */
.modal-body > div {
  margin-bottom: 20px;
}

.modal-body h4 {
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 8px;
  font-weight: 600;
}

/* Improve stats grid spacing */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-card h3 {
  margin: 0 0 10px 0;
  font-size: 1rem;
  color: #666;
  font-weight: 600;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

/* Better button consistency */
.btn-primary,
.btn-secondary {
  padding: 10px 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5a6fd8;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

/* Responsive improvements */
@media (max-width: 768px) {
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .modal-content {
    margin: 2% auto;
    width: 95%;
    max-width: none;
  }

  .compact-item {
    font-size: 0.85rem;
    padding: 5px 8px;
  }
}

@media (max-width: 480px) {
  .stat-card {
    padding: 15px;
  }

  .stat-card h3 {
    font-size: 0.9rem;
  }

  .stat-value {
    font-size: 1.3rem;
  }
}
/ * Enhanced modal visual hierarchy */ .supply-info,
.market-stats,
.ath-atl-info {
  background: rgba(102, 126, 234, 0.02);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.price-changes {
  background: rgba(40, 167, 69, 0.02);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid rgba(40, 167, 69, 0.1);
}

/* Better spacing for modal sections */
.modal-body > div:last-child {
  margin-bottom: 0;
}

/* Improve change value styling */
.change-value.positive {
  color: #28a745;
  font-weight: 600;
}

.change-value.negative {
  color: #dc3545;
  font-weight: 600;
}
