:root {
  --bg-primary: #0a1628;
  --bg-secondary: #0f1f3a;
  --bg-tertiary: #162a4a;
  --bg-input: #122240;
  --bg-hover: #1e3355;
  --text-primary: #e4e4ef;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b80;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-dim: rgba(59, 130, 246, 0.15);
  --border: #1e3355;
  --error: #ef4444;
  --success: #22c55e;
  --radius: 10px;
  --radius-sm: 6px;
  --font-size-base: 13px;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --bg-input: #f1f3f5;
  --bg-hover: #dee2e6;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #868e96;
  --accent: #1d4ed8;
  --accent-hover: #2563eb;
  --accent-dim: rgba(29, 78, 216, 0.1);
  --border: #dee2e6;
}

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

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

.app { max-width: 720px; margin: 0 auto; }

.header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.logo { width: 32px; height: 32px; border-radius: var(--radius-sm); }

.header h1 { font-size: 18px; font-weight: 700; color: var(--accent); }

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: 0 20px;
}

.tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.content { padding: 20px; }

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

.provider-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.provider-card.configured { border-color: var(--accent); }

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

.provider-name {
  font-size: 14px;
  font-weight: 600;
}

.provider-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.provider-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.provider-badge.active { background: var(--accent-dim); color: var(--accent); }
.provider-badge.inactive { background: var(--bg-tertiary); color: var(--text-muted); }

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

.provider-fields .input { flex: 1; }

.provider-fields .input:disabled { opacity: 0.5; }

.btn-test {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-test:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-test.success { border-color: var(--success); color: var(--success); }
.btn-test.error { border-color: var(--error); color: var(--error); }
.btn-test.loading { opacity: 0.6; cursor: wait; }

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.input, .select-sm {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 60px; }

.info-box {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.info-box strong { color: var(--accent); }
.info-box a { color: var(--accent); }

.about {
  text-align: center;
  padding: 20px 0;
}

.about-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: white;
  margin: 0 auto 12px;
}

.about h2 { font-size: 20px; color: var(--accent); }
.version { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.about p { color: var(--text-secondary); font-size: 13px; margin-bottom: 12px; }

.about-section {
  text-align: left;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
}

.about-section h3 { font-size: 14px; color: var(--accent); margin-bottom: 8px; }
.about-section ul { padding-left: 18px; }
.about-section li { color: var(--text-secondary); font-size: 13px; margin-bottom: 4px; }

.btn-update {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.15s;
}
.btn-update:hover { background: var(--accent-hover); }
.btn-update:disabled { opacity: 0.5; cursor: wait; }

.update-status {
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 20px;
}
.update-status.info { color: var(--accent); }
.update-status.success { color: var(--success); }
.update-status.error { color: var(--error); }

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.shortcut-item kbd {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: monospace;
  font-size: 11px;
  color: var(--text-primary);
  min-width: 80px;
  text-align: center;
}

.changelog-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.changelog-modal.open {
  display: flex;
}

.changelog-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.changelog-modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.changelog-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.changelog-modal-header h3 {
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 2px;
}

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

.changelog-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.changelog-close-btn:hover {
  color: var(--text-primary);
}

.changelog-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.changelog-modal-body ul {
  list-style: none;
  padding: 0;
}

.changelog-modal-body li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.changelog-modal-body li:last-child {
  border-bottom: none;
}

.changelog-modal-body li::before {
  content: '•';
  color: var(--accent);
  font-weight: bold;
  margin-right: 8px;
}

.changelog-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.changelog-modal-footer .btn-update {
  margin-bottom: 0;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
