@layer pages {
/* ============================================
   Downloads Page Styles
   CadBridge download page layout
   ============================================ */

/* --- Page Container --- */
.downloads-page {
    min-height: 100vh;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
}

.downloads-content {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
    flex: 1;
}

/* --- Back Link --- */
.downloads-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--accent);
    text-decoration: none;
    margin-bottom: var(--space-6);
    transition: color var(--transition-fast);
}

.downloads-back:hover {
    color: var(--accent-hover);
}

/* --- Page Title --- */
.downloads-content h1 {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 var(--space-2) 0;
    letter-spacing: -0.02em;
}

.downloads-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-8);
}

/* --- Download Card --- */
.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
    margin-bottom: var(--space-8);
}

.download-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.download-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border-radius: var(--border-radius);
    color: var(--accent);
}

.download-card-info h2 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-1) 0;
}

.download-version-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-success);
    background: var(--color-success-glow);
    padding: 2px var(--space-2);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-mono);
}

.download-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-6);
}

.download-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.download-actions .btn svg {
    flex-shrink: 0;
}

/* --- Metadata Grid --- */
.download-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-color);
}

.download-meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.download-meta-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.download-meta-value {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

/* --- Checksum Row --- */
.download-checksum {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--surface-1);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-6);
}

.checksum-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.checksum-value {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.checksum-copy-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: var(--space-1) var(--space-2);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.checksum-copy-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-glow);
}

.checksum-copy-btn.copied {
    color: var(--color-success);
    border-color: var(--color-success);
}

/* --- Section Headings --- */
.downloads-content h2 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--space-10) 0 var(--space-4) 0;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-color);
}

.downloads-content h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

/* --- Body Text --- */
.downloads-content > p,
.downloads-section p {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 var(--space-4) 0;
}

/* --- Lists --- */
.downloads-content ul,
.downloads-content ol {
    margin: 0 0 var(--space-4) 0;
    padding-left: var(--space-6);
    color: var(--text-secondary);
    line-height: 1.7;
}

.downloads-content li {
    margin-bottom: var(--space-2);
    font-size: var(--text-base);
}

/* --- Links --- */
.downloads-content a:not(.btn):not(.downloads-back) {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.downloads-content a:not(.btn):not(.downloads-back):hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* --- Getting Started Steps --- */
.getting-started-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin: var(--space-4) 0 var(--space-6) 0;
}

.getting-started-step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: var(--text-sm);
    font-weight: 700;
}

.step-text {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.6;
}

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

/* --- Skeleton Loading --- */
.download-skeleton {
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-line {
    height: 16px;
    background: var(--surface-2);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--space-3);
}

.skeleton-line.skeleton-wide {
    width: 80%;
}

.skeleton-line.skeleton-medium {
    width: 60%;
}

.skeleton-line.skeleton-narrow {
    width: 40%;
}

.skeleton-btn {
    height: 44px;
    width: 200px;
    background: var(--surface-2);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--space-4);
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Requirements Grid --- */
.requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-4);
    margin: var(--space-4) 0;
}

.requirement-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

.requirement-item svg {
    flex-shrink: 0;
    color: var(--accent);
}

.requirement-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.requirement-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .downloads-content {
        padding: var(--space-6) var(--space-4);
    }

    .downloads-content h1 {
        font-size: var(--text-2xl);
    }

    .downloads-content h2 {
        font-size: var(--text-lg);
    }

    .download-card {
        padding: var(--space-6);
    }

    .download-card-header {
        flex-direction: column;
        gap: var(--space-4);
    }

    .download-checksum {
        flex-direction: column;
        align-items: flex-start;
    }

    .checksum-value {
        word-break: break-all;
        white-space: normal;
    }

    .download-meta {
        grid-template-columns: 1fr 1fr;
    }

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

/* --- Reduced motion support --- */
@media (prefers-reduced-motion: reduce) {
    .downloads-content * {
        transition: none;
    }

    .download-skeleton {
        animation: none;
    }
}

} /* end @layer pages */
