/* Plugins CSS */

/* --- Plugin Grid (List View) --- */
.plugins-hero {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-dark) 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
    text-align: center;
}

.plugins-hero h1 span {
    color: var(--bs-info);
}

.plugin-filters {
    background: var(--bs-gray-800, #343a40);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.filter-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select, .search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--bs-gray-600, #6c757d);
    border-radius: 0.25rem;
    background: var(--bs-gray-900, #212529);
    color: white;
    flex: 1;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.plugin-card {
    background: var(--bs-gray-800, #343a40);
    border: 1px solid var(--bs-gray-700, #495057);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.plugin-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: var(--bs-primary);
}

.plugin-icon-wrapper {
    position: relative;
    height: 200px;
    background: var(--bs-gray-900, #212529);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.plugin-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.plugin-icon {
    max-width: 64px;
    max-height: 64px;
}

.plugin-type-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: bold;
    backdrop-filter: blur(4px);
}

.plugin-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.plugin-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.plugin-title a {
    color: white;
    text-decoration: none;
}

.plugin-title a:hover {
    color: var(--bs-primary);
}

.plugin-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--bs-gray-400, #adb5bd);
}

.compatibility-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--bs-success);
}

.plugin-description {
    color: var(--bs-gray-300, #dee2e6);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: auto;
    overflow: hidden;
}

.plugin-description p {
    margin-bottom: 0;
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--bs-gray-400, #adb5bd);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

.plugin-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-gray-700, #495057);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Plugin Detail --- */
.plugin-detail-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

@media (max-width: 992px) {
    .plugin-detail-layout {
        grid-template-columns: 1fr;
    }
}

.plugin-main-content .card {
    background: var(--bs-gray-800, #343a40);
    border: 1px solid var(--bs-gray-700, #495057);
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.card-content {
    padding: 1.5rem;
}

.card-content h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bs-gray-700, #495057);
    color: var(--bs-gray-100, #f8f9fa);
    letter-spacing: -0.01em;
}

/* ── Prose (markdown rendered content) ── */
.plugin-prose {
    color: var(--bs-gray-300, #dee2e6);
    line-height: 1.75;
    font-size: 0.95rem;
    word-break: break-word;
}

.plugin-prose > *:last-child {
    margin-bottom: 0;
}

.plugin-prose h1,
.plugin-prose h2,
.plugin-prose h3,
.plugin-prose h4 {
    color: var(--bs-gray-100, #f8f9fa);
    font-weight: 600;
    line-height: 1.35;
    margin-top: 1.75em;
    margin-bottom: 0.6em;
}

.plugin-prose h1 { font-size: 1.5rem; }
.plugin-prose h2 {
    font-size: 1.25rem;
    padding-bottom: 0.4em;
    border-bottom: 1px solid var(--bs-gray-700, #495057);
}
.plugin-prose h3 { font-size: 1.1rem; }
.plugin-prose h4 { font-size: 1rem; color: var(--bs-gray-300, #dee2e6); }

.plugin-prose h1:first-child,
.plugin-prose h2:first-child,
.plugin-prose h3:first-child {
    margin-top: 0;
}

.plugin-prose p {
    margin-bottom: 1em;
}

.plugin-prose ul,
.plugin-prose ol {
    margin-bottom: 1em;
    padding-left: 1.75em;
}

.plugin-prose ul { list-style: disc; }
.plugin-prose ul ul { list-style: circle; }
.plugin-prose ol { list-style: decimal; }

.plugin-prose li {
    margin-bottom: 0.4em;
    line-height: 1.65;
}

.plugin-prose li > p {
    margin-bottom: 0.4em;
}

.plugin-prose strong {
    color: var(--bs-gray-100, #f8f9fa);
    font-weight: 600;
}

.plugin-prose code {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.2em 0.45em;
    border-radius: 0.3rem;
    font-size: 0.85em;
    color: var(--bs-info, #0dcaf0);
    border: 1px solid var(--bs-gray-700, #495057);
    white-space: nowrap;
}

.plugin-prose pre {
    background: var(--bs-gray-900, #212529);
    padding: 1.25rem 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.25em;
    border: 1px solid var(--bs-gray-700, #495057);
    line-height: 1.55;
}

.plugin-prose pre code {
    background: none;
    padding: 0;
    border: none;
    color: var(--bs-gray-300, #dee2e6);
    font-size: 0.85rem;
    white-space: pre;
}

.plugin-prose blockquote {
    border-left: 4px solid var(--bs-primary);
    padding: 0.75rem 1.25rem;
    margin: 1.25em 0;
    color: var(--bs-gray-400, #adb5bd);
    background: rgba(0, 0, 0, 0.12);
    border-radius: 0 0.375rem 0.375rem 0;
}

.plugin-prose blockquote p:last-child {
    margin-bottom: 0;
}

.plugin-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1em 0;
}

.plugin-prose a {
    color: var(--bs-info, #0dcaf0);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.plugin-prose a:hover {
    border-bottom-color: var(--bs-info, #0dcaf0);
}

.plugin-prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25em;
    font-size: 0.9rem;
}

.plugin-prose th,
.plugin-prose td {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--bs-gray-700, #495057);
    text-align: left;
}

.plugin-prose th {
    background: var(--bs-gray-900, #212529);
    font-weight: 600;
    color: var(--bs-gray-100, #f8f9fa);
    white-space: nowrap;
}

.plugin-prose tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.1);
}

.plugin-prose hr {
    border: none;
    border-top: 1px solid var(--bs-gray-700, #495057);
    margin: 2em 0;
}

.plugin-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    display: block;
    border-radius: 0.5rem;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--bs-gray-900, #212529);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.5rem;
    font-size: 0.75rem;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.video-item {
    margin-bottom: 1.5rem;
}

.video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 0.5rem;
    background: black;
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- Releases --- */
.plugin-releases {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.release-item {
    background: var(--bs-gray-900, #212529);
    padding: 1.25rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--bs-gray-600, #6c757d);
    transition: border-color 0.2s;
}

.release-item:hover {
    border-left-color: var(--bs-primary);
}

.release-latest {
    border-left-color: var(--bs-success);
    background: rgba(25, 135, 84, 0.1);
}

.release-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.release-version {
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.release-changelog {
    font-size: 0.9rem;
    color: var(--bs-gray-400, #adb5bd);
    padding: 0.75rem 1rem;
    border-left: 2px solid var(--bs-gray-700, #495057);
    margin: 0.75rem 0 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 0.25rem 0.25rem 0;
}

.release-changelog ul {
    margin: 0;
    padding-left: 1.25em;
}

.release-changelog li {
    margin-bottom: 0.25em;
}

.release-changelog p {
    margin-bottom: 0.5em;
}

.release-changelog p:last-child {
    margin-bottom: 0;
}

/* --- Documentation --- */
.plugin-docs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.doc-item {
    background: var(--bs-gray-900, #212529);
    border-radius: 0.5rem;
    padding: 1.25rem;
    border: 1px solid var(--bs-gray-700, #495057);
}

.doc-item + .doc-item {
    margin-top: 0.25rem;
}

.doc-title {
    font-size: 1rem;
    color: var(--bs-gray-100, #f8f9fa);
    margin-bottom: 0.25rem;
}

.doc-description {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.doc-child {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--bs-gray-800, #343a40);
    border-radius: 0.375rem;
    padding: 1rem;
}

.doc-content {
    margin-top: 0.5rem;
}

/* docs page cards */
.doc-lead {
    color: var(--bs-gray-400, #adb5bd);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--bs-gray-700, #495057);
}

.doc-lead p:last-child {
    margin-bottom: 0;
}

.plugin-doc-card {
    background: var(--bs-gray-900, #212529);
    border: 1px solid var(--bs-gray-700, #495057);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: border-color 0.2s;
}

.plugin-doc-card:hover {
    border-color: var(--bs-gray-600, #6c757d);
}

.plugin-doc-card[open] {
    border-color: var(--bs-primary);
}

.plugin-doc-card > summary {
    cursor: pointer;
    list-style: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    user-select: none;
    transition: background 0.15s;
}

.plugin-doc-card > summary:hover {
    background: rgba(255, 255, 255, 0.03);
}

.plugin-doc-card > summary::-webkit-details-marker {
    display: none;
}

.plugin-doc-card > summary::before {
    content: "\f054";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.7rem;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--bs-gray-400, #adb5bd);
    flex-shrink: 0;
}

.plugin-doc-card[open] > summary::before {
    transform: rotate(90deg);
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.1);
}

.plugin-doc-card > summary h3 {
    display: inline;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    color: var(--bs-gray-100, #f8f9fa);
}

.plugin-doc-card-body {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--bs-gray-700, #495057);
}

/* --- Sidebar --- */
.plugin-sidebar-card {
    background: var(--bs-gray-800, #343a40);
    border: 1px solid var(--bs-gray-700, #495057);
    border-radius: 0.5rem;
    position: sticky;
    top: 6rem;
}

.sidebar-icon-wrapper {
    text-align: center;
    margin-bottom: 1rem;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.action-btn {
    width: 100%;
    text-align: center;
}

.plugin-specs {
    border-top: 1px solid var(--bs-gray-700, #495057);
    padding-top: 1rem;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.875rem;
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    color: var(--bs-gray-400, #adb5bd);
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.spec-value {
    text-align: right;
    color: var(--bs-gray-200, #e9ecef);
    font-weight: 500;
}

.plugin-social-links {
    border-top: 1px solid var(--bs-gray-700, #495057);
    padding-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* --- Issues --- */
.plugin-issues-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.issue-item {
    background: var(--bs-gray-900, #212529);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--bs-gray-700, #495057);
    transition: border-color 0.2s;
}

.issue-item:hover {
    border-color: var(--bs-gray-500, #6c757d);
}

.issue-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.issue-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-gray-100, #f8f9fa);
}

.issue-description {
    font-size: 0.875rem;
}

/* --- Lightbox --- */
.plugin-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    padding: 2rem;
}

.plugin-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.plugin-lightbox img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: var(--bs-danger);
}

.lightbox-bottom {
    margin-top: 1rem;
    text-align: center;
    width: 100%;
    max-width: 90%;
}

.lightbox-caption {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.lightbox-original-link {
    color: var(--bs-info);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--bs-info);
    border-radius: 2rem;
    transition: all 0.2s;
}

.lightbox-original-link:hover {
    background: var(--bs-info);
    color: black;
}
