/* AdAutomate API — B2B Design System */
:root {
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --secondary: #764ba2;
  --bg: #f7fafc;
  --card-bg: #ffffff;
  --text: #2d3748;
  --text-light: #4a5568;
  --text-muted: #a0aec0;
  --border: #e2e8f0;
  --success: #48bb78;
  --warning: #ed8936;
  --danger: #f56565;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

* { 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); line-height: 1.6;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; padding: 24px 0;
}
.header-inner { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.header h1 { font-size: 28px; margin-bottom: 4px; }
.header p { font-size: 14px; opacity: 0.9; }

/* Language Bar */
.lang-bar { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.lang-btn {
  padding: 6px 12px; border: 1px solid rgba(255,255,255,0.3); border-radius: 6px;
  background: transparent; color: #fff; font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.lang-btn:hover { background: rgba(255,255,255,0.15); }
.lang-btn.active { background: #fff; color: var(--primary); border-color: #fff; font-weight: 600; }

/* Tabs */
.tabs { max-width: 1000px; margin: 20px auto 0; padding: 0 20px; display: flex; gap: 8px; }
.tab-btn {
  padding: 10px 24px; border: none; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--card-bg); color: var(--text-light); font-size: 14px; font-weight: 500;
  cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Main */
.main { max-width: 1000px; margin: 0 auto; padding: 20px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Cards */
.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card h2 { font-size: 18px; margin-bottom: 12px; color: var(--text); }
.card p { font-size: 14px; color: var(--text-light); margin-bottom: 8px; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-light); margin-bottom: 4px; }
.input, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; outline: none; transition: border-color 0.2s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102,126,234,0.15); }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Buttons */
.btn {
  padding: 10px 20px; border: none; border-radius: var(--radius); font-size: 14px;
  font-weight: 500; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { opacity: 0.9; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Endpoint Table */
.endpoint-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.endpoint-table th { text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--border); font-size: 12px; color: var(--text-muted); text-transform: uppercase; }
.endpoint-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.method { font-weight: 700; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.method.get { background: #ebf8ff; color: #3182ce; }
.method.post { background: #f0fff4; color: #38a169; }
.method.put { background: #fffaf0; color: #dd6b20; }
.method.delete { background: #fff5f5; color: #e53e3e; }

/* Code */
.code-block {
  background: #1a202c; color: #68d391; padding: 12px 16px; border-radius: var(--radius);
  font-family: 'SF Mono', 'Cascadia Code', monospace; font-size: 13px; overflow-x: auto; margin: 8px 0;
}
.code-textarea {
  width: 100%; padding: 12px; background: #1a202c; color: #68d391; border: 1px solid var(--border);
  border-radius: var(--radius); font-family: monospace; font-size: 12px; resize: vertical;
}

/* Status */
.status { margin-top: 12px; font-size: 14px; }
.status.loading { color: var(--warning); }
.status.success { color: var(--success); }
.status.error { color: var(--danger); }

/* Results */
.results { margin-top: 16px; }
.audit-score {
  display: inline-block; padding: 8px 20px; border-radius: 20px; font-size: 20px; font-weight: 700;
  margin-bottom: 16px;
}
.score-a { background: #c6f6d5; color: #22543d; }
.score-b { background: #e6fffa; color: #234e52; }
.score-c { background: #fefcbf; color: #744210; }
.score-d { background: #fed7d7; color: #9b2c2c; }
.score-f { background: #feb2b2; color: #742a2a; }

.check-result { padding: 8px 12px; margin-bottom: 4px; border-radius: 4px; font-size: 13px; border-left: 3px solid; }
.check-pass { background: #f0fff4; border-color: var(--success); }
.check-fail { background: #fff5f5; border-color: var(--danger); }
.check-warn { background: #fffaf0; border-color: var(--warning); }
.check-skip { background: #f7fafc; border-color: var(--text-muted); color: var(--text-muted); }

.history { margin-top: 16px; }
.history-item { padding: 8px 12px; border: 1px solid var(--border); margin-bottom: 4px; border-radius: 4px; font-size: 13px; }

/* Widget Container */
.widget-container {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 16px;
  background: #f7fafc; min-height: 300px; text-align: center; display: flex; align-items: center; justify-content: center;
}

/* Footer */
.footer { text-align: center; padding: 16px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); margin-top: 40px; }
.footer a { color: var(--primary); text-decoration: none; }

/* Responsive */
@media (max-width: 768px) {
  .header h1 { font-size: 22px; }
  .tabs { overflow-x: auto; }
  .endpoint-table { font-size: 11px; }
  .endpoint-table th, .endpoint-table td { padding: 4px 6px; }
  .btn-group { flex-direction: column; }
}
