* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #0c0f16 0%, #161b22 100%);
  color: #e6edf3;
  min-height: 100vh;
  line-height: 1.6;
}

/* Header */
header {
  background: rgba(22, 27, 34, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(48, 54, 61, 0.5);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.currency-selector select {
  background: rgba(30, 41, 59, 0.8);
  color: #e6edf3;
  border: 1px solid rgba(248, 250, 252, 0.2);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.currency-selector select:hover {
  background: rgba(30, 41, 59, 1);
  border-color: rgba(124, 58, 237, 0.5);
}

.currency-selector select:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.network-badge {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  display: none;
}

#connectBtn {
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

#connectBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

#connectBtn:disabled {
  background: #374151;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Balance Card */
.balance-card {
  background: linear-gradient(135deg, rgba(22, 27, 34, 0.8), rgba(30, 41, 59, 0.8));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(248, 250, 252, 0.1);
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(59, 130, 246, 0.1));
  z-index: -1;
}

.balance-card h2 {
  font-size: 1.1rem;
  color: #9ca3af;
  margin-bottom: 12px;
  font-weight: 500;
}

#totalBalance {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.balance-subtitle {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Chart Container */
.chart-container {
  background: rgba(22, 27, 34, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(248, 250, 252, 0.1);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 32px;
}

.chart-header {
  margin-bottom: 20px;
}

.chart-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #f9fafb;
}

.chart-wrapper {
  position: relative;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state {
  text-align: center;
  color: #6b7280;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 4px;
  color: #9ca3af;
}

.empty-state span {
  font-size: 0.9rem;
  color: #6b7280;
}

/* Tokens Section */
.tokens-section {
  background: rgba(22, 27, 34, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(248, 250, 252, 0.1);
  border-radius: 20px;
  padding: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #f9fafb;
}

.token-count {
  background: rgba(124, 58, 237, 0.2);
  color: #c4b5fd;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Loading State */
.loading-state {
  display: none;
  text-align: center;
  padding: 40px;
  color: #9ca3af;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(124, 58, 237, 0.3);
  border-top: 3px solid #7c3aed;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
  display: none;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-weight: 500;
}

/* Token List */
.token-list {
  display: grid;
  gap: 12px;
}

.token-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(248, 250, 252, 0.1);
  transition: all 0.3s ease;
}

.token-item:hover {
  background: rgba(30, 41, 59, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.token-item.has-balance {
  border-left: 4px solid #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.token-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.token-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #374151, #4b5563);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: bold;
  color: #e6edf3;
}

.token-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.token-details h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f9fafb;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.verified-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 50%;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
}

.token-symbol {
  font-size: 0.9rem;
  color: #9ca3af;
  font-weight: 500;
}

.token-price {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 2px;
}

.token-source {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 2px;
  text-transform: capitalize;
}

.token-value {
  text-align: right;
}

.token-balance {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f9fafb;
  margin-bottom: 4px;
}

.token-usd {
  font-size: 0.9rem;
  color: #10b981;
  font-weight: 500;
}

/* Footer */
footer {
  background: rgba(22, 27, 34, 0.8);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(48, 54, 61, 0.5);
  margin-top: 40px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

#twitterBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #1d9bf0, #0ea5e9);
  color: white;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

#twitterBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(29, 155, 240, 0.3);
}

.footer-info {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-right {
    gap: 12px;
  }

  .currency-selector select {
    font-size: 16px;
    min-height: 44px;
    padding: 10px 14px;
  }

  .container {
    padding: 20px 16px;
  }

  .balance-card {
    padding: 24px 20px;
  }

  #totalBalance {
    font-size: 2.5rem;
  }

  .chart-wrapper {
    height: 250px;
  }

  .footer-content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .token-item {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .token-info {
    width: 100%;
  }

  .token-value {
    width: 100%;
    text-align: left;
  }

  .token-icon {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  #totalBalance {
    font-size: 2rem;
  }

  .chart-wrapper {
    height: 200px;
  }
}