/* Downloads Page — v1.0 */

.downloads-page {
    padding-top: 64px;
    min-height: 100vh;
    background: #f8fafc;
}

/* ===== HERO ===== */
.downloads-hero {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    padding: 72px 0 56px;
    text-align: center;
    overflow: hidden;
}

.downloads-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 50%, rgba(45, 190, 96, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 500px 300px at 80% 30%, rgba(9, 120, 239, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.downloads-hero h1 {
    font-size: 40px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}

.downloads-hero-subtitle {
    font-size: 17px;
    color: rgba(255,255,255,0.6);
    max-width: 540px;
    margin: 0 auto 32px;
    line-height: 1.5;
}

.downloads-hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.downloads-hero-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-weight: 500;
}

.downloads-hero-stat svg {
    opacity: 0.6;
}

/* ===== CATEGORIES ===== */
.downloads-categories {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 0;
    position: sticky;
    top: 64px;
    z-index: 10;
}

.downloads-categories .container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.downloads-categories .container::-webkit-scrollbar {
    display: none;
}

.downloads-cat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 100px;
    background: #fff;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-family: inherit;
}

.downloads-cat:hover {
    border-color: #2dbe60;
    color: #2dbe60;
}

.downloads-cat.active {
    background: #2dbe60;
    border-color: #2dbe60;
    color: #fff;
}

.downloads-cat.active svg {
    stroke: #fff;
}

/* ===== CONTENT ===== */
.downloads-content {
    padding: 40px 0 80px;
}

.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

/* ===== CARD ===== */
.download-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    border: 1px solid #e2e8f0;
    position: relative;
    transition: box-shadow 0.25s, transform 0.25s;
    display: flex;
    flex-direction: column;
}

.download-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.download-card-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(45, 190, 96, 0.1);
    color: #2dbe60;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.download-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #2dbe60;
}

.download-card-icon svg {
    width: 36px;
    height: 36px;
}

.download-card-icon--blue {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #0978ef;
}

.download-card-badge--app {
    background: rgba(9, 120, 239, 0.1);
    color: #0978ef;
}

.download-card-title {
    font-size: 19px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px;
    line-height: 1.3;
    padding-right: 80px;
}

.download-card-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.download-card-desc.expanded {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.download-desc-toggle {
    background: none;
    border: none;
    color: #0978ef;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
    font-family: inherit;
}

.download-desc-toggle:hover {
    text-decoration: underline;
}

/* Tags */
.download-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.download-tag {
    padding: 4px 10px;
    border-radius: 100px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
}

/* Meta */
.download-card-meta {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 16px;
}

.download-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

.download-meta-item svg {
    color: #cbd5e1;
}

/* Instructions */
.download-card-instructions {
    margin-bottom: 20px;
}

.download-card-instructions summary {
    font-size: 13px;
    font-weight: 600;
    color: #0978ef;
    cursor: pointer;
    padding: 8px 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.download-card-instructions summary::-webkit-details-marker {
    display: none;
}

.download-card-instructions summary::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid #0978ef;
    border-bottom: 2px solid #0978ef;
    transform: rotate(-45deg);
    transition: transform 0.2s;
}

.download-card-instructions[open] summary::before {
    transform: rotate(45deg);
}

.download-card-instructions ol {
    margin: 8px 0 0;
    padding: 0 0 0 20px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.8;
}

.download-card-instructions code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #0f172a;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* Requirements */
.download-card-requirements {
    font-size: 12px;
    color: #94a3b8;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.download-card-requirements strong {
    color: #64748b;
}

/* Card Link */
.download-card-link {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #0978ef;
    font-size: 14px;
    font-weight: 600;
    padding-top: 12px;
}

a.download-card:hover .download-card-link {
    text-decoration: underline;
}

a.download-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Download Button */
.download-btn {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: #2dbe60;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.download-btn:hover {
    background: #27ae60;
}

.download-btn:active {
    transform: scale(0.98);
}

/* ===== CARD TITLE LINK ===== */
.download-card-title a {
    color: inherit;
    text-decoration: none;
}

.download-card-title a:hover {
    color: #0978ef;
}

/* ===== DETAIL PAGE ===== */
.dl-detail-breadcrumb {
    padding: 80px 0 0;
    background: #f8fafc;
}

.dl-detail-breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding-top: 16px;
}

.dl-detail-breadcrumb a {
    color: #0978ef;
    text-decoration: none;
}

.dl-detail-breadcrumb a:hover {
    text-decoration: underline;
}

.dl-detail-breadcrumb span {
    color: #64748b;
}

.dl-detail-breadcrumb svg {
    color: #cbd5e1;
}

.dl-detail {
    background: #f8fafc;
    padding: 24px 0 80px;
}

.dl-detail .container {
    max-width: 800px;
}

.dl-detail-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}

.dl-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.dl-detail-icon {
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2dbe60;
}

.dl-detail-icon svg {
    width: 40px;
    height: 40px;
}

.dl-detail-icon--blue {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #0978ef;
}

.dl-detail-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    background: rgba(45, 190, 96, 0.1);
    color: #2dbe60;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.dl-detail-badge--app {
    background: rgba(9, 120, 239, 0.1);
    color: #0978ef;
}

.dl-detail-title {
    font-size: 26px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 4px;
    line-height: 1.2;
}

.dl-detail-subtitle {
    font-size: 15px;
    color: #64748b;
    margin: 0;
}

.dl-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 16px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 24px;
}

.dl-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.dl-detail-meta-item svg {
    color: #94a3b8;
}

.dl-detail-section {
    margin-top: 28px;
}

.dl-detail-section h2 {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
}

.dl-detail-section p {
    font-size: 14px;
    color: #475569;
    line-height: 1.7;
    margin: 0 0 10px;
}

.dl-detail-section code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #0f172a;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.dl-detail-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dl-detail-features li {
    position: relative;
    padding: 6px 0 6px 28px;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

.dl-detail-features li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 11px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(45, 190, 96, 0.1);
    border: 2px solid #2dbe60;
}

.dl-detail-features li::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 14px;
    width: 4px;
    height: 7px;
    border-right: 2px solid #2dbe60;
    border-bottom: 2px solid #2dbe60;
    transform: rotate(45deg);
}

.dl-detail-steps {
    margin: 0;
    padding: 0 0 0 20px;
    font-size: 14px;
    color: #475569;
    line-height: 1.8;
}

.dl-detail-steps li {
    padding: 4px 0;
}

.dl-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dl-detail-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}

.dl-detail-table td:first-child {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    width: 40%;
}

.dl-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.dl-detail-actions {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.dl-detail-actions .download-btn {
    width: auto;
    flex: 1;
    margin-top: 0;
}

.dl-detail-back {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.dl-detail-back:hover {
    color: #0978ef;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .downloads-hero {
        padding: 48px 0 40px;
    }

    .downloads-hero h1 {
        font-size: 28px;
    }

    .downloads-hero-subtitle {
        font-size: 15px;
        padding: 0 16px;
    }

    .downloads-hero-stats {
        gap: 20px;
    }

    .downloads-categories {
        top: 56px;
    }

    .downloads-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .download-card {
        padding: 20px;
    }

    .download-card-title {
        font-size: 17px;
        padding-right: 70px;
    }

    .download-card-meta {
        gap: 12px;
        flex-wrap: wrap;
    }

    .downloads-content {
        padding: 24px 0 60px;
    }

    .dl-detail-card {
        padding: 20px;
    }

    .dl-detail-header {
        flex-direction: column;
        gap: 12px;
    }

    .dl-detail-title {
        font-size: 22px;
    }

    .dl-detail-meta {
        gap: 12px;
    }

    .dl-detail-actions {
        flex-direction: column;
    }

    .dl-detail-actions .download-btn {
        width: 100%;
    }

    .dl-detail-table td:first-child {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .downloads-hero h1 {
        font-size: 24px;
    }

    .downloads-hero-stats {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .download-card-badge {
        top: 14px;
        right: 14px;
        font-size: 11px;
    }
}
