/* ========================================
   Project Page Specific Styles
   ======================================== */

/* ========================================
   Project Header
   ======================================== */

.breadcrumb-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.breadcrumb {
    font-size: 0.9rem;
}

.breadcrumb a {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all var(--transition);
    box-shadow: 0 2px 4px var(--shadow);
}

.breadcrumb a:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
    text-decoration: none;
}

.project-header {
    margin-bottom: var(--spacing-md);
}

.project-header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.project-meta {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.github-link a {
    color: var(--accent);
    font-weight: 500;
}

.stats {
    display: flex;
    gap: var(--spacing-sm);
}

/* ========================================
   Layout
   ======================================== */

.project-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--spacing-lg);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-md);
}

.project-nav {
    position: sticky;
    top: var(--spacing-md);
    height: fit-content;
}

.project-nav nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm);
}

.project-nav a {
    padding: var(--spacing-xs);
    border-radius: 4px;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text-secondary);
}

.project-nav a:hover {
    background: var(--bg-secondary);
    color: var(--accent);
    text-decoration: none;
}

.content-wrapper {
    min-width: 0;
}

/* ========================================
   Sections
   ======================================== */

section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

section:last-child {
    border-bottom: none;
}

section h2 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    font-size: 1.8rem;
}

/* ========================================
   Latest Release Banner
   ======================================== */

.highlight-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
}

.highlight-section h2 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.release-banner {
    background: var(--bg-card);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
}

.release-info {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
    align-items: center;
}

.version-tag {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-block;
}

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

.release-banner h3 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.btn-secondary {
    display: inline-block;
    margin-top: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--accent);
    color: white;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: all var(--transition);
    border: none;
}

.btn-secondary:hover {
    background: var(--accent-hover);
    text-decoration: none;
}

/* ========================================
   README & Markdown Content
   ======================================== */

.markdown-body {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    line-height: 1.8;
    font-size: 1rem;
}

.markdown-body h1 {
    font-size: 2rem;
    margin: 2rem 0 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
}

.markdown-body h1:first-child {
    margin-top: 0;
}

.markdown-body h2 {
    font-size: 1.6rem;
    margin: 1.8rem 0 1rem;
    font-weight: 600;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
}

.markdown-body h3 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.8rem;
    font-weight: 600;
}

.markdown-body h4 {
    font-size: 1.1rem;
    margin: 1.2rem 0 0.6rem;
    font-weight: 600;
}

.markdown-body p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.markdown-body ul, .markdown-body ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
    line-height: 1.8;
}

.markdown-body li {
    margin-bottom: 0.4rem;
}

.markdown-body li > p {
    margin-bottom: 0.5rem;
}

.markdown-body strong {
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-body code {
    background: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.markdown-body pre {
    background: var(--code-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid var(--border);
    line-height: 1.6;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    border: none;
    font-size: 0.9rem;
    line-height: 1.6;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px var(--shadow);
}

.markdown-body a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}

.markdown-body a:hover {
    border-bottom-color: var(--accent);
}

.markdown-body blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.markdown-body hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 2rem 0;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.markdown-body table th,
.markdown-body table td {
    border: 1px solid var(--border);
    padding: 0.6rem 1rem;
    text-align: left;
}

.markdown-body table th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.markdown-body table tr:hover {
    background: var(--bg-secondary);
}

/* ========================================
   Screenshots
   ======================================== */

.screenshots-section {
    margin-top: var(--spacing-lg);
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.screenshot-grid figure {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.screenshot-grid figure:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--shadow);
}

.screenshot-grid a {
    display: block;
    cursor: pointer;
    text-decoration: none;
}

.screenshot-grid img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity var(--transition);
}

.screenshot-grid a:hover img {
    opacity: 0.9;
}

.screenshot-grid figcaption {
    padding: var(--spacing-sm);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

/* ========================================
   Releases List
   ======================================== */

.releases-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.release-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    transition: all var(--transition);
}

.release-item:hover {
    box-shadow: 0 4px 12px var(--shadow);
    border-color: var(--accent);
}

.release-header {
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border);
}

.release-header h3 {
    margin: var(--spacing-xs) 0;
    font-size: 1.3rem;
}

.release-header time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.release-body,
.release-notes {
    margin: var(--spacing-sm) 0;
    color: var(--text-primary);
    line-height: 1.8;
}

.release-body ul,
.release-notes ul {
    margin-left: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.release-body li,
.release-notes li {
    margin-bottom: 0.4rem;
}

.release-body code,
.release-notes code {
    background: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
    border: 1px solid rgba(240, 246, 252, 0.15);
    color: var(--text-primary);
}

.release-body pre,
.release-notes pre {
    background: var(--code-bg);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid rgba(240, 246, 252, 0.15);
}

.release-body pre code,
.release-notes pre code {
    background: transparent;
    padding: 0;
    border: none;
}

.release-body h2,
.release-body h3,
.release-body h4,
.release-notes h2,
.release-notes h3,
.release-notes h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.release-body strong,
.release-notes strong {
    font-weight: 600;
    color: var(--text-primary);
}

.release-link {
    display: inline-block;
    margin-top: var(--spacing-sm);
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}

.release-link:hover {
    text-decoration: underline;
}

/* ========================================
   Community Links
   ======================================== */

.community-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.community-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    transition: all var(--transition);
    display: block;
    text-decoration: none;
}

.community-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px var(--shadow);
    text-decoration: none;
}

.community-card h3 {
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    font-size: 1.2rem;
}

.community-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}

.badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ========================================
   Loading States
   ======================================== */

#readme-loading,
#releases-loading,
#changelog-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-lg);
    font-style: italic;
}

/* ========================================
   Lightbox Gallery
   ======================================== */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: white;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    max-width: 80%;
    text-align: center;
}

/* ========================================
   Footer Back Button
   ======================================== */

footer .container p:first-child a {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all var(--transition);
    box-shadow: 0 2px 4px var(--shadow);
}

footer .container p:first-child a:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
    text-decoration: none;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .project-content {
        grid-template-columns: 1fr;
    }

    .project-nav {
        position: static;
        margin-bottom: var(--spacing-md);
    }

    .project-nav nav {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
    }

    .project-header h1 {
        font-size: 2rem;
    }

    .screenshot-grid {
        grid-template-columns: 1fr;
    }

    .community-links {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .project-header h1 {
        font-size: 1.5rem;
    }

    .project-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    section h2 {
        font-size: 1.5rem;
    }
}
