/* frontend/css/styles.css */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
}

/* Credit Card - specific UI enhancements */
.credit-card-container {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(2, 6, 23, 0.25);
  margin-top: 1rem;
}

.step-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-card);
  margin-bottom: 0.75rem;
}

.token-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.progress-bar {
  height: 8px;
  background: #1f2937;
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0 0.5rem 0;
}

.progress-bar > span {
  display: block;
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, var(--primary), #a3e635);
}

.eligible-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.not-eligible {
  color: #f87171;
  font-weight: 700;
}

.step-indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 0.5rem;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.step-item.active {
  opacity: 1;
}

.step-item.completed {
  opacity: 0.8;
}

.step-item.completed .step-number {
  background: var(--success);
}

.step-number {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.step-item.active .step-number {
  background: var(--primary);
}

.step-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.wallet-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 320px;
  margin: 0 auto;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.btn-icon {
  font-size: 1.5rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chain-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chain-status-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.chain-name {
  color: var(--text);
}

.chain-status-indicator {
  font-size: 0.875rem;
}

.chain-status-indicator.complete {
  color: var(--success);
}

.chain-status-indicator.error {
  color: var(--error);
}

.chain-status-indicator.scanning {
  animation: spin 1s linear infinite;
}

.eligibility-result {
  padding: 1.5rem;
  border-radius: 0.75rem;
  text-align: center;
  margin-bottom: 1rem;
}

.eligibility-result.eligible {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.eligibility-result.not-eligible {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.success-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--success);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 1rem auto;
}

.tx-details {
  background: var(--bg);
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.tx-hash {
  font-family: monospace;
  font-size: 0.75rem;
  word-break: break-all;
  color: var(--primary);
}

.token-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.usd-value {
  font-weight: 600;
  color: var(--text);
}

.chain-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg);
  border-radius: 0.25rem;
  color: var(--text-muted);
}

.token-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  color: #f87171;
}

.error-message p {
  margin-bottom: 0.5rem;
  color: inherit;
}

.error-message p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .step-indicator {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .step-item {
    flex: 1 1 calc(33% - 0.5rem);
    min-width: 60px;
  }
  
  .step-label {
    display: none;
  }
  
  .wallet-buttons {
    max-width: 100%;
  }
  
  .token-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .token-value {
    width: 100%;
    justify-content: flex-start;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 2rem;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--text);
}

.hero {
  text-align: center;
  padding: 6rem 2rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.chain-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.chain-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.chain-btn:hover,
.chain-btn.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.wallet-address {
  font-family: monospace;
  background: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.token-list {
  margin-top: 1rem;
}

.token-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.token-item:last-child {
  border-bottom: none;
}

.token-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.token-symbol {
  font-weight: 600;
  width: 3rem;
}

.token-balance {
  color: var(--text-muted);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-approved {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.status-pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.hidden {
  display: none !important;
}

footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.error-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--error);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
