.codespark-file-download {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px 16px 60px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.codespark-file-download:hover {
    border-color: #3182ce;
    box-shadow: 0 4px 16px rgba(49, 130, 206, 0.12);
}

.codespark-file-download__badge {
    --codespark-badge-start: #dc2626;
    --codespark-badge-end: #b91c1c;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--codespark-badge-start), var(--codespark-badge-end));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.codespark-file-download__link {
    flex: 1;
    text-decoration: none;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.codespark-file-download__title {
    color: #1a202c;
    font-size: 16px;
    font-weight: 600;
    word-break: break-word;
    transition: color 0.2s ease;
}

.codespark-file-download__link:hover .codespark-file-download__title {
    color: #3182ce;
}

.codespark-file-download__link:focus {
    outline: 3px solid #3182ce;
    outline-offset: 2px;
    border-radius: 4px;
}

.codespark-file-download__meta {
    font-size: 12px;
    color: #1b1e22;
    font-weight: 500;
    background: #edf2f7;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.codespark-file-download__button {
    padding: 10px 16px;
    border: 2px solid #dc2626;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    background: #dc2626;
    color: #fff;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.codespark-file-download__button:link,
.codespark-file-download__button:visited {
    color: #fff;
}

.codespark-file-download__button:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
    text-decoration: underline;
}

.codespark-file-download__button:focus {
    outline: 3px solid #3182ce;
    outline-offset: 2px;
}

.codespark-file-download__button-meta {
    font-size: 12px;
    opacity: 0.9;
    color: inherit;
}

@media (max-width: 640px) {
    .codespark-file-download {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-left: 20px;
        padding-top: 60px;
    }

    .codespark-file-download__badge {
        left: 20px;
        top: 16px;
        transform: none;
    }

    .codespark-file-download__link {
        text-align: left;
    }

    .codespark-file-download__button {
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-contrast: high) {
    .codespark-file-download {
        border-color: #000000;
    }

    .codespark-file-download__badge {
        background: #000000;
    }

    .codespark-file-download__title {
        color: #000000;
    }
}

@media (prefers-reduced-motion: reduce) {
    .codespark-file-download,
    .codespark-file-download__title,
    .codespark-file-download__button {
        transition: none;
    }
}
