/* File Download Blocks - Frontend Styles */

.fdb-download-block {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.fdb-download-block:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.fdb-download-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Alignment classes */
.fdb-align-left {
    text-align: left;
}

.fdb-align-center {
    text-align: center;
}

.fdb-align-center .fdb-download-container {
    justify-content: center;
}

.fdb-align-right {
    text-align: right;
}

.fdb-align-right .fdb-download-container {
    justify-content: flex-end;
}

/* Thumbnail styles */
.fdb-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 160px;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fdb-thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fdb-no-thumbnail {
    background: #f8f9fa;
}

.fdb-placeholder-icon {
    font-size: 48px;
    color: #6c757d;
}

/* Content area */
.fdb-content {
    flex: 1;
    min-width: 0;
}

.fdb-file-info {
    margin-bottom: 15px;
}

.fdb-file-name {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

/* Meta information */
.fdb-meta {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.fdb-file-type,
.fdb-file-size {
    display: inline-block;
    padding: 2px 8px;
    background: #e9ecef;
    border-radius: 12px;
    margin-right: 8px;
}

.fdb-file-type {
    background-color: #dbeafe;
    color: #1e40af;
}

.fdb-file-size {
    background-color: #f0fdf4;
    color: #166534;
}

/* Download action */
.fdb-download-action {
    margin-top: 15px;
}

.fdb-download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.fdb-download-link:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.fdb-download-link:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.fdb-download-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.fdb-download-icon {
    font-size: 16px;
}

.fdb-download-text {
    font-size: 14px;
}

/* Screen reader only text */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .fdb-download-block {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }

    .fdb-download-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .fdb-align-left .fdb-download-container,
    .fdb-align-right .fdb-download-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .fdb-thumbnail {
        width: 100px;
        height: 140px;
    }

    .fdb-file-name {
        font-size: 1.125rem;
        text-align: center;
    }

    .fdb-meta {
        justify-content: center;
    }

    .fdb-download-action {
        margin-top: 0.75rem;
        text-align: center;
    }

    .fdb-download-link {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .fdb-download-block {
        padding: 0.5rem;
        margin: 0.5rem 0;
    }

    .fdb-download-container {
        gap: 0.5rem;
    }

    .fdb-thumbnail {
        width: 80px;
        height: 100px;
    }

    .fdb-file-name {
        font-size: 1rem;
        margin-bottom: 0.375rem;
    }

    .fdb-meta {
        gap: 0.5rem;
    }

    .fdb-file-type,
    .fdb-file-size {
        font-size: 0.75rem;
        padding: 0.1875rem 0.375rem;
    }

    .fdb-download-link {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
        gap: 0.375rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .fdb-download-block {
        border: 2px solid #000000;
        background-color: #ffffff;
    }

    .fdb-download-link {
        background-color: #000000;
        color: #ffffff;
        border: 2px solid #000000;
    }

    .fdb-download-link:hover {
        background-color: #ffffff;
        color: #000000;
        border: 2px solid #000000;
    }

    .fdb-file-type,
    .fdb-file-size {
        background-color: #ffffff;
        color: #000000;
        border: 1px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .fdb-download-block,
    .fdb-download-link {
        transition: none;
    }

    .fdb-download-link:hover {
        transform: none;
    }

    .fdb-download-link:active {
        transform: none;
    }
}

/* Print styles */
@media print {
    .fdb-download-block {
        box-shadow: none;
        border: 1px solid #000000;
        break-inside: avoid;
    }

    .fdb-download-link {
        background-color: transparent;
        color: #000000;
        border: 1px solid #000000;
    }

    .fdb-download-link::after {
        content: " (" attr(href) ")";
        font-size: 0.75rem;
        color: #666666;
    }
}