/* Versions / Changelog Page Styles */

.versions-hero {
  margin-top: 80px;
  padding: 4rem 2rem 3rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(6, 182, 212, 0.05));
}

.versions-hero-content h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.6rem;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.versions-hero-content p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 640px;
  margin: 0 auto;
}

.versions-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem;
}

/* ===== Реестр / Роспатент ===== */
.legal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.3s, transform 0.3s;
}

.legal-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
}

.legal-card-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.3rem;
}

.legal-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(6, 182, 212, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.legal-card h3 {
  font-size: 1.05rem;
  line-height: 1.3;
}

.legal-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.legal-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.legal-link {
  margin-top: auto;
  padding-top: 0.6rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  word-break: break-all;
}

.legal-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ===== Timeline ===== */
.timeline-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.timeline {
  position: relative;
  padding-left: 2.2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent), transparent);
}

.tl-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.tl-item::before {
  content: '';
  position: absolute;
  left: -2.2rem;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 3px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.tl-item.past::before {
  border-color: var(--text-muted);
  box-shadow: none;
}

.tl-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.tl-version {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tl-item.past .tl-version {
  background: none;
  -webkit-text-fill-color: var(--text-muted);
  color: var(--text-muted);
}

.tl-date {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.tag {
  padding: 0.25rem 0.85rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag-current {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}

.tag-closed {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tag-open {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.tl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.tl-item.past .tl-card {
  border-style: dashed;
  opacity: 0.92;
}

.tl-lead {
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

/* Changelog groups */
.change-group {
  margin-bottom: 1.2rem;
}

.change-group:last-child {
  margin-bottom: 0;
}

.change-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}

.change-label.added { color: var(--success); }
.change-label.improved { color: var(--primary); }
.change-label.fixed { color: var(--warning); }

.change-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.4rem 1.2rem;
}

.change-list li {
  position: relative;
  padding-left: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.change-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.change-group.added .change-list li::before { background: var(--success); }
.change-group.improved .change-list li::before { background: var(--primary); }
.change-group.fixed .change-list li::before { background: var(--warning); }

/* Capability split (offline / AI) */
.cap-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.2rem;
}

.cap-box {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
}

.cap-box h4 {
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cap-box ul {
  list-style: none;
}

.cap-box li {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.2rem 0;
  display: flex;
  gap: 0.4rem;
}

.cap-box li::before {
  content: '→';
  color: var(--primary);
  flex-shrink: 0;
}

.cap-note {
  margin-top: 1rem;
  background: rgba(16, 185, 129, 0.07);
  border-left: 3px solid var(--success);
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Tech stack */
.stack-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.stack-chip {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
}

.stack-chip strong {
  color: var(--primary);
}

.stack-chip span {
  color: var(--text-muted);
  display: block;
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

/* Licensing note */
.license-note {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin-top: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.license-note strong {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .versions-container { padding: 1rem; }
  .cap-split { grid-template-columns: 1fr; }
  .change-list { grid-template-columns: 1fr; }
}

/* ===== Compact additions ===== */
.scope-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 2rem;
}
.scope-banner p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; margin: 0; }
.scope-banner strong { color: var(--text-primary); }
.scope-banner a { color: var(--accent); text-decoration: none; }
.scope-banner a:hover { text-decoration: underline; }
.scope-pill {
  flex-shrink: 0;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--primary);
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid var(--border);
  padding: 0.25rem 0.7rem; border-radius: 20px;
  margin-top: 0.1rem;
}

/* compact legal card: title + meta stacked next to icon */
.legal-card-head > div h3 { margin: 0; }
.legal-card .legal-link { margin-top: 0.8rem; }

/* compact changelog rows */
.change-row {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.change-row:first-of-type { border-top: none; }
.change-tag {
  flex-shrink: 0;
  width: 120px;
  font-size: 0.78rem; font-weight: 700;
}
.change-tag.added { color: var(--success); }
.change-tag.improved { color: var(--primary); }
.change-tag.fixed { color: var(--warning); }

@media (max-width: 600px) {
  .change-row { flex-direction: column; gap: 0.2rem; }
  .change-tag { width: auto; }
  .scope-banner { flex-direction: column; gap: 0.5rem; }
}

/* ===== РЕД ОС compatibility certificate card ===== */
.legal-card.redos { border-color: rgba(220, 38, 38, 0.35); }
.legal-card.redos:hover { border-color: #ef4444; }
.legal-icon.redos {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.20), rgba(239, 68, 68, 0.12));
}
.cert-status {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.32);
  padding: 0.25rem 0.85rem;
  border-radius: 20px;
}
.cert-links { margin-top: auto; display: flex; flex-direction: column; gap: 0.4rem; padding-top: 0.7rem; }
.cert-links .legal-link { margin-top: 0; padding-top: 0; }
