/**
 * Страница плагина
 */

.plugin-page {
  padding: var(--space-xl) 0;
}

.plugin-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.plugin-gallery {
  min-width: 0;
}

.gallery-main {
  aspect-ratio: 16/10;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-md);
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.gallery-thumb {
  width: 80px;
  height: 50px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-tertiary);
  transition: border-color 0.2s;
}
.gallery-thumb:hover,
.gallery-thumb.active {
  border-color: var(--accent);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-placeholder {
  aspect-ratio: 16/10;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: var(--accent);
}

.plugin-info h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-md);
}

.plugin-badges-top {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.plugin-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: var(--space-md);
}

.plugin-short {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.plugin-author {
  font-size: 0.9375rem;
  margin-bottom: var(--space-xl);
}

.plugin-purchase {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.plugin-price-block {
  margin-bottom: var(--space-md);
}
.price-current {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.price-old {
  text-decoration: line-through;
  color: var(--text-muted);
  margin-right: var(--space-md);
}

.plugin-tabs {
  display: flex;
  gap: var(--space-lg);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}
.tab-link {
  padding: var(--space-md) 0;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-link:hover {
  color: var(--text-primary);
}
.tab-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.plugin-content {
  max-width: 800px;
}

@media (max-width: 980px) {
  .plugin-layout {
    grid-template-columns: 1fr;
  }
  .plugin-info {
    order: 2;
  }
}

@media (max-width: 640px) {
  .plugin-page {
    padding: var(--space-lg) var(--space-sm);
  }
  .plugin-layout {
    width: min(92vw, 520px);
    margin: 0 auto;
  }
  .plugin-content {
    padding: 0 var(--space-sm);
  }
  .plugin-tabs {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
  .plugin-meta {
    flex-wrap: wrap;
    row-gap: var(--space-xs);
  }
  .plugin-purchase {
    padding: var(--space-md);
  }
  .gallery-thumbs {
    gap: var(--space-xs);
  }
  .gallery-thumb {
    width: 70px;
    height: 44px;
  }
}

.plugin-content.is-loading {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.json-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.json-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.json-title {
  font-weight: 600;
}

.json-content {
  background: #0b0f14;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e6edf3;
}

.json-code {
  white-space: pre;
}

.json-block.is-collapsed .json-content {
  max-height: 220px;
}

.json-fallback {
  margin-top: var(--space-md);
}

.json-block:not(.is-invalid) .json-fallback {
  display: none;
}

.json-key {
  color: #7ee787;
}
.json-string {
  color: #a5d6ff;
}
.json-number {
  color: #f2cc60;
}
.json-boolean {
  color: #ff7b72;
}
.json-null {
  color: #8b949e;
}

.content-html {
  line-height: 1.7;
}
.content-html p {
  margin-bottom: var(--space-md);
}

.plugin-compatibility {
  margin-top: var(--space-xl);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
}

.changelog-list {
  list-style: none;
}
.changelog-list li {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
}
.changelog-list li:last-child {
  border-bottom: none;
}
.changelog-version {
  font-weight: 600;
  margin-right: var(--space-md);
}
.changelog-date {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.changelog-changes {
  margin-top: var(--space-sm);
  color: var(--text-secondary);
}

.review-form {
  margin-bottom: var(--space-xl);
}
.rating-input {
  display: flex;
  gap: var(--space-md);
}
.rating-input label {
  cursor: pointer;
  color: var(--text-secondary);
}
.rating-input input {
  margin-right: 4px;
}

.rating-stars {
  gap: 6px;
  flex-direction: row-reverse;
  justify-content: flex-start;
  position: relative;
}
.rating-stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rating-stars label {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
}
.rating-stars label span {
  display: inline-block;
  transform-origin: center;
}
.rating-stars label:hover {
  color: var(--accent);
  transform: translateY(-1px);
}
.rating-stars label:hover ~ label {
  color: var(--accent);
}
.rating-stars input:checked + label,
.rating-stars input:checked + label ~ label {
  color: var(--accent);
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.review-item {
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.review-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}
.review-date {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-left: auto;
}
.review-comment {
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .plugin-layout {
    grid-template-columns: 1fr;
  }
}
