/* ═══════════════════════════════════════════════
   License Compatibility Checker — Dark Theme
   ═══════════════════════════════════════════════ */

:root {
  --primary: #10B981;
  --primary-hover: #059669;
  --secondary: #34D399;
  --accent: #EF4444;
  --warning: #F59E0B;
  --bg: #0A140A;
  --bg-elevated: #0F1F0F;
  --bg-card: #142814;
  --bg-input: #0D1A0D;
  --text: #E2F0E2;
  --text-muted: #94B894;
  --text-dim: #607860;
  --border: #1E3A1E;
  --border-hover: #2D5A2D;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --transition: 200ms ease;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

.app { display: flex; flex-direction: column; height: 100vh; }

/* ─── Header ──────────────────────────────── */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--bg-elevated);
  border-bottom: 1px solid var(--border); gap: 12px; flex-shrink: 0;
}

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

.logo {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.1));
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}

.header-title {
  font-size: 1.1rem; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.header-badge {
  font-size: 0.65rem; font-weight: 600; padding: 3px 8px;
  background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px;
}

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

/* ─── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; font-size: 0.8rem; font-weight: 500; font-family: var(--font);
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4); }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-card); color: var(--text); border-color: var(--border-hover); }

.select-control {
  padding: 6px 12px; font-size: 0.8rem; font-family: var(--font);
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); cursor: pointer;
}

/* ─── Main ────────────────────────────────── */
.main {
  display: grid; grid-template-columns: 1fr 1fr; flex: 1;
  overflow: hidden; gap: 1px; background: var(--border);
}

.panel { display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--bg-elevated);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}

.panel-title { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }

.format-badges { display: flex; gap: 4px; }

.format-badge {
  font-size: 0.65rem; font-weight: 500; padding: 3px 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
  color: var(--text-dim); cursor: pointer; transition: all var(--transition);
}
.format-badge.active, .format-badge:hover {
  background: rgba(16, 185, 129, 0.1); border-color: var(--primary); color: var(--primary);
}

.input-area {
  flex: 1; width: 100%; padding: 20px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem; line-height: 1.7; background: var(--bg); color: var(--text);
  border: none; resize: none; outline: none; tab-size: 2;
}
.input-area::placeholder { color: var(--text-dim); }

/* ─── Results ─────────────────────────────── */
.results { flex: 1; overflow-y: auto; padding: 16px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 12px; color: var(--text-dim); font-size: 0.85rem;
}

.risk-summary { display: flex; gap: 8px; }

.risk-badge {
  font-size: 0.65rem; font-weight: 600; padding: 3px 8px;
  border-radius: 20px; display: flex; align-items: center; gap: 4px;
}
.risk-badge.green { background: rgba(16, 185, 129, 0.1); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.2); }
.risk-badge.yellow { background: rgba(245, 158, 11, 0.1); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.2); }
.risk-badge.red { background: rgba(239, 68, 68, 0.1); color: #EF4444; border: 1px solid rgba(239, 68, 68, 0.2); }

/* ─── Dep Card ────────────────────────────── */
.dep-card {
  padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px; transition: all var(--transition);
}
.dep-card:hover { border-color: var(--border-hover); }

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

.dep-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }

.dep-light {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.dep-light.green { background: #10B981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.dep-light.yellow { background: #F59E0B; box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.dep-light.red { background: #EF4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }

.dep-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.dep-license {
  font-size: 0.7rem; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; background: rgba(16, 185, 129, 0.1); color: var(--secondary);
}

.dep-type { font-size: 0.65rem; color: var(--text-dim); }

.dep-obligations {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(30, 58, 30, 0.5);
}
.dep-obligations ul { list-style: none; padding: 0; }
.dep-obligations li {
  font-size: 0.72rem; color: var(--text-muted); padding: 2px 0;
  display: flex; align-items: center; gap: 6px;
}

.dep-warning {
  margin-top: 6px; padding: 6px 10px; background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15); border-radius: 6px;
  font-size: 0.7rem; color: #EF4444;
}

/* ─── Compatibility Matrix ────────────────── */
.matrix-section { margin-top: 24px; }
.matrix-section h3 {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  color: var(--primary); margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.matrix-table { width: 100%; border-collapse: collapse; font-size: 0.7rem; }
.matrix-table th, .matrix-table td {
  padding: 6px 10px; text-align: center; border: 1px solid var(--border);
}
.matrix-table th { background: var(--bg-elevated); color: var(--text-muted); font-weight: 600; }
.matrix-table td.compat { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.matrix-table td.warn { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.matrix-table td.incompat { background: rgba(239, 68, 68, 0.1); color: #EF4444; }

/* ─── Toast ───────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 10px 20px; background: var(--bg-card); border: 1px solid var(--primary);
  border-radius: var(--radius-sm); color: var(--primary); font-size: 0.8rem;
  font-weight: 500; box-shadow: var(--shadow); z-index: 200;
  animation: toast-in 0.3s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .main { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .header { flex-wrap: wrap; gap: 8px; }
  .header-right { width: 100%; justify-content: flex-end; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
