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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
  min-height: 100vh;
}

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

header {
  padding: 32px 0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #0f172a;
}

header p {
  color: #64748b;
  margin-top: 4px;
}

.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  gap: 16px;
  flex-wrap: wrap;
}

.category-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
}

.cat-tab {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
}

.cat-tab:hover {
  color: #1e293b;
}

.cat-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.refresh-btn {
  padding: 8px 16px;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
}

.refresh-btn:hover {
  background: #1e293b;
}

.timestamp {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 16px;
}

.loading {
  text-align: center;
  padding: 80px 0;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: #0f172a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

/* Provider Grid */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.provider-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow 0.2s;
}

.provider-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.provider-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.provider-name {
  font-weight: 600;
  font-size: 1rem;
}

.provider-badge {
  font-size: 0.625rem;
  padding: 2px 8px;
  border-radius: 100px;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.provider-badge.tier-1 { background: #fef3c7; color: #92400e; }
.provider-badge.tier-2 { background: #e0e7ff; color: #3730a3; }
.provider-badge.tier-3 { background: #dcfce7; color: #166534; }
.provider-badge.tier-4 { background: #f3e8ff; color: #6b21a8; }
.provider-badge.ai { background: #fce7f3; color: #9d174d; }

.provider-models {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 12px;
}

.provider-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.provider-price-label {
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
}

/* AI Section */
.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #0f172a;
}

.ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.ai-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  border-top: 3px solid #8b5cf6;
}

.ai-card.anthropic { border-top-color: #cc6244; }
.ai-card.openai { border-top-color: #74a430; }
.ai-card.googleai { border-top-color: #4285f4; }
.ai-card.deepseek { border-top-color: #3ec0c5; }
.ai-card.moonshot { border-top-color: #7b68ee; }
.ai-card.minimax { border-top-color: #7b68ee; }
.ai-card.zhipu { border-top-color: #7b68ee; }

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

.ai-name {
  font-weight: 600;
  font-size: 1rem;
}

.ai-share {
  font-size: 0.75rem;
  color: #94a3b8;
}

.ai-models {
  font-size: 0.875rem;
}

.ai-model-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  align-items: center;
}

.ai-model-row:last-child {
  border-bottom: none;
}

.ai-model-name {
  font-weight: 500;
}

.ai-model-context {
  font-size: 0.75rem;
  color: #94a3b8;
}

.ai-model-price {
  font-family: monospace;
  font-size: 0.8rem;
  text-align: right;
  white-space: nowrap;
}

/* Tables */
.table-container {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 32px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f8fafc;
}

.provider-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price {
  font-family: monospace;
}

/* Alerts */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.alert-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.alert-badge.aws { background: #fef3c7; color: #92400e; }
.alert-badge.gcp { background: #dbeafe; color: #1e40af; }
.alert-badge.azure { background: #dbeafe; color: #1e40af; }

.alert-change {
  font-weight: 600;
  font-family: monospace;
}

.alert-change.up { color: #dc2626; }
.alert-change.down { color: #16a34a; }

.no-data {
  text-align: center;
  padding: 48px;
  color: #94a3b8;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

footer {
  text-align: center;
  padding: 32px 0;
  color: #94a3b8;
  font-size: 0.875rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 48px;
}

@media (max-width: 768px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .category-tabs {
    justify-content: center;
  }
  
  .provider-grid,
  .ai-grid {
    grid-template-columns: 1fr;
  }
}