/* License Page Styles */
:root {
  --bg0: #f6f8fa;
  --bg1: #ffffff;
  --ink: #1b1f24;
  --ink-soft: #57606a;
  --ink-softer: #8b949e;
  --line: #d1d9e0;
  --cyan: #0077a8;
  --cyan-deep: #055980;
  --cyan-glow: rgba(0, 119, 168, 0.12);
  --paper: #ffffff;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --radius: 8px;
}

[data-theme="dark"] {
  --bg0: #0d1117;
  --bg1: #161b22;
  --ink: #e6edf3;
  --ink-soft: #8b949e;
  --ink-softer: #6e7681;
  --line: #30363d;
  --cyan: #58a6ff;
  --cyan-deep: #79c0ff;
  --cyan-glow: rgba(88, 166, 255, 0.12);
  --paper: rgba(22, 27, 34, 0.85);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

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

body {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg0);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header - using shared styles from app.css */

.lang,
.theme-toggle {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg0);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}

.lang:hover,
.theme-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Main */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
}

.hero h1 {
  font-family: "Sora", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Sections */
.section {
  margin-bottom: 3rem;
}

.section-title {
  font-family: "Sora", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--cyan);
  display: inline-block;
}

/* License Card (main) */
.license-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.main-license {
  border-left: 4px solid var(--cyan);
}

.license-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.license-body h3 {
  font-family: "Sora", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.license-body p {
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}

/* License Badges */
.license-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
}

.badge-mit {
  background: #e6f7e6;
  color: #1a7f1a;
}

.badge-apache {
  background: #fff3e0;
  color: #e65100;
}

.badge-ofl {
  background: #e8eaf6;
  color: #283593;
}

.badge-public {
  background: #e0f2f1;
  color: #00695c;
}

.badge-proprietary {
  background: #fce4ec;
  color: #c62828;
}

[data-theme="dark"] .badge-mit {
  background: rgba(26, 127, 26, 0.2);
  color: #81c784;
}

[data-theme="dark"] .badge-apache {
  background: rgba(230, 81, 0, 0.2);
  color: #ffab91;
}

[data-theme="dark"] .badge-ofl {
  background: rgba(40, 53, 147, 0.2);
  color: #9fa8da;
}

[data-theme="dark"] .badge-public {
  background: rgba(0, 105, 92, 0.2);
  color: #80cbc4;
}

[data-theme="dark"] .badge-proprietary {
  background: rgba(198, 40, 40, 0.2);
  color: #ef9a9a;
}

/* Tables */
.license-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.license-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.license-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--bg0);
  border-bottom: 2px solid var(--line);
}

.license-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

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

.license-table tr:hover td {
  background: var(--cyan-glow);
}

.license-table a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 500;
}

.license-table a:hover {
  text-decoration: underline;
}

/* CDN List */
.cdn-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cdn-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.cdn-item strong {
  min-width: 100px;
  color: var(--ink);
}

.cdn-item code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.82rem;
  color: var(--cyan-deep);
  background: var(--cyan-glow);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  word-break: break-all;
}

/* Notes */
.note {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--cyan-glow);
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* License Text Blocks */
.license-text-block {
  margin-bottom: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.license-text-block summary {
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--bg0);
  list-style: none;
}

.license-text-block summary::-webkit-details-marker {
  display: none;
}

.license-text-block summary::before {
  content: "▸ ";
  color: var(--ink-softer);
  font-size: 0.8rem;
}

.license-text-block[open] summary::before {
  content: "▾ ";
}

.component-tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--cyan-deep);
  background: var(--cyan-glow);
  border-radius: 3px;
  vertical-align: middle;
}

.license-text {
  padding: 1rem;
  margin: 0;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--bg0);
  overflow-x: auto;
  white-space: pre-wrap;
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--ink-softer);
  font-size: 0.85rem;
}

.footer a {
  color: var(--cyan-deep);
  text-decoration: none;
  font-weight: 600;
  margin-right: 0.75rem;
}

.footer a:hover {
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 768px) {
  main {
    padding: 1rem;
  }

  .hero {
    padding: 2rem 0.5rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .lede {
    font-size: 1rem;
  }

  .license-card {
    flex-direction: column;
    gap: 0.75rem;
  }

  .cdn-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .cdn-item code {
    font-size: 0.75rem;
  }
}
