:root {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #e5e5e5;
  --green: #22c55e;
  --green-bg: #dcfce7;
  --red: #ef4444;
  --red-bg: #fee2e2;
  --yellow: #f59e0b;
  --yellow-bg: #fef3c7;
  --apostar: #0066ff;
  --betboom: #ff6b35;
  --websites: #8b5cf6;
  --vps: #10b981;
}

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

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--yellow-bg);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--yellow);
}

.header-badge.online {
  background: var(--green-bg);
  color: var(--green);
}

.header-badge .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

.last-update {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
}

.btn-refresh {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-refresh:hover {
  background: var(--bg);
  border-color: var(--text-secondary);
  color: var(--text);
}

.btn-refresh.loading svg {
  animation: spin 0.8s linear infinite;
}

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

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  color: var(--apostar);
  border-bottom-color: var(--apostar);
}

.tab svg {
  opacity: 0.7;
}

.tab.active svg {
  opacity: 1;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--red);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Main */
.main {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.main .platform-section + .platform-section {
  margin-top: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Platform Section */
.platform-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.platform-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.platform-indicator {
  width: 3px;
  height: 16px;
  border-radius: 2px;
}

.platform-indicator.apostar { background: var(--apostar); }
.platform-indicator.betboom { background: var(--betboom); }
.platform-indicator.websites { background: var(--websites); }
.platform-indicator.vps { background: var(--vps); }

.platform-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* API Cards Grid */
.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* API Card */
.api-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: all 0.15s ease;
}

.api-card:hover {
  border-color: #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.card-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-provider {
  font-size: 12px;
  color: var(--text-muted);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-pill.online {
  background: var(--green-bg);
  color: var(--green);
}

.status-pill.offline {
  background: var(--red-bg);
  color: var(--red);
}

.status-pill.error {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Card Stats */
.card-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.stat-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.stat-value.highlight {
  color: var(--green);
}

.stat-value.warning {
  color: var(--red);
}

/* Error message */
.error-msg {
  margin-top: 12px;
  padding: 8px;
  background: var(--red-bg);
  border-radius: 4px;
  font-size: 11px;
  color: var(--red);
}

/* Website card specific */
.website-card .website-stats {
  grid-template-columns: 1fr auto;
}

.url-value {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

/* Loading state */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  color: var(--text-muted);
  gap: 16px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--apostar);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Incidents Section */
.incidents-header {
  margin-bottom: 24px;
}

.incidents-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.incidents-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.incidents-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.incident-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.15s ease;
}

.incident-card:hover {
  border-color: #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.incident-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.incident-icon.ongoing {
  background: var(--red-bg);
  color: var(--red);
}

.incident-icon.resolved {
  background: var(--green-bg);
  color: var(--green);
}

.incident-content {
  flex: 1;
  min-width: 0;
}

.incident-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.incident-service {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  background: var(--bg);
  border-radius: 4px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.incident-time {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.incident-time svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
  opacity: 0.5;
}

.incident-duration {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
}

.incident-duration.ongoing {
  background: var(--red-bg);
  color: var(--red);
}

.incident-duration.resolved {
  background: var(--green-bg);
  color: var(--green);
}

.incidents-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.incidents-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.incidents-empty p {
  font-size: 15px;
}

.incidents-empty .subtitle {
  font-size: 13px;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 600px) {
  .app {
    padding: 16px;
  }
  
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .api-grid {
    grid-template-columns: 1fr;
  }
  
  .tabs {
    overflow-x: auto;
  }
  
  .tab {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .incident-card {
    flex-direction: column;
    gap: 12px;
  }
  
  .incident-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}
