/* ==========================================================================
   Product Documents & File Badges
   ========================================================================== */

/* File format badge base */
.file-format-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
    box-sizing: border-box;
    transition: transform 0.15s ease;
}

/* Format specific color themes */
.file-format-badge.format-pdf {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.file-format-badge.format-dwg {
    background-color: #dbeafe;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.file-format-badge.format-bim {
    background-color: #ede9fe;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}

.file-format-badge.format-3d {
    background-color: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.file-format-badge.format-zip {
    background-color: #ffedd5;
    color: #ea580c;
    border: 1px solid #fed7aa;
}

.file-format-badge.format-doc {
    background-color: #e0e7ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}

.file-format-badge.format-xls {
    background-color: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.file-format-badge.format-img {
    background-color: #fce7f3;
    color: #db2777;
    border: 1px solid #fbcfe8;
}

.file-format-badge.format-other {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* Accordion Documents List */
.accordion .product-docs-list,
.product-docs-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 4px 0 8px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    font-size: 14px !important;
}

.accordion .product-docs-list > li,
.product-docs-list > li {
    list-style: none !important;
    position: static !important;
    border: none !important;
    border-radius: 0 !important;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: normal !important;
}

.product-doc-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    gap: 12px;
    box-sizing: border-box;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.product-doc-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    border-color: #cbd5e1;
}

.product-doc-format {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.product-doc-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-doc-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.product-doc-category {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    display: block;
}

.product-doc-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.btn-doc-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-doc-download:hover {
    background-color: #059669;
    color: #ffffff;
    border-color: #059669;
    transform: scale(1.05);
}

.btn-doc-download svg {
    display: block;
}

/* Modal Files Preview in #downloadModal */
.modal-files-preview {
    margin: 14px 0 16px 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    text-align: left;
    box-sizing: border-box;
}

.modal-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-files-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.modal-files-count {
    font-size: 11px;
    font-weight: 700;
    color: #059669;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid #a7f3d0;
}

.modal-files-scroll {
    max-height: 165px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
}

.modal-files-scroll::-webkit-scrollbar {
    width: 5px;
}

.modal-files-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.modal-files-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.modal-files-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal-files-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.modal-file-item:hover {
    border-color: #cbd5e1;
    background-color: #ffffff;
}

.modal-file-item .file-format-badge {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: 9.5px;
    border-radius: 6px;
}

.modal-file-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.modal-file-name {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.modal-file-category {
    font-size: 10px;
    font-weight: 500;
    color: #64748b;
    display: block;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .product-doc-card {
        padding: 8px 10px;
        gap: 10px;
    }

    .file-format-badge {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 10px;
    }

    .product-doc-title {
        font-size: 12.5px;
    }

    .product-doc-category {
        font-size: 10.5px;
    }

    .btn-doc-download {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .modal-files-scroll {
        max-height: 140px;
    }
}
