/* === ITSMD Member Files Browser === */

.itsmd-mf-browser {
    max-width: 800px;
    font-family: inherit;
}

/* Icons */
.itsmd-mf-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* Category header */
.itsmd-mf-category {
    margin-bottom: 16px;
}

.itsmd-mf-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: left;
    transition: background 0.15s ease;
    font-family: inherit;
}

.itsmd-mf-category-header:hover {
    background: #ebebeb;
}

.itsmd-mf-category-header .itsmd-mf-icon-folder {
    width: 22px;
    height: 22px;
    color: #e8a840;
}

.itsmd-mf-category-count {
    background: #ddd;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.itsmd-mf-category-header .itsmd-mf-icon-chevron {
    width: 18px;
    height: 18px;
    color: #888;
    transition: transform 0.2s ease;
}

.itsmd-mf-category-header[aria-expanded="false"] .itsmd-mf-icon-chevron {
    transform: rotate(-90deg);
}

.itsmd-mf-category-header[aria-expanded="false"] + .itsmd-mf-file-list {
    display: none;
}

/* Collapsed state: flatten bottom border radius on header */
.itsmd-mf-category-header[aria-expanded="false"] {
    border-radius: 8px;
}

/* File list */
.itsmd-mf-file-list {
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

/* File row */
.itsmd-mf-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s ease;
}

.itsmd-mf-file-row:last-child {
    border-bottom: none;
}

.itsmd-mf-file-row:hover {
    background: #fafafa;
}

/* File icon */
.itsmd-mf-file-icon .itsmd-mf-icon {
    width: 24px;
    height: 24px;
}

.itsmd-mf-icon-pdf {
    color: #e74c3c;
}

.itsmd-mf-icon-image {
    color: #27ae60;
}

.itsmd-mf-icon-spreadsheet {
    color: #27ae60;
}

.itsmd-mf-icon-document {
    color: #3498db;
}

/* File info */
.itsmd-mf-file-info {
    flex: 1;
    min-width: 0;
}

.itsmd-mf-file-title {
    display: block;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.itsmd-mf-file-title:hover {
    color: #0073aa;
    text-decoration: underline;
}

.itsmd-mf-file-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 13px;
    color: #888;
}

.itsmd-mf-file-ext {
    background: #eee;
    color: #666;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

/* Download button */
.itsmd-mf-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #888;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.itsmd-mf-download-btn:hover {
    background: #e8f4fd;
    color: #0073aa;
}

/* Member message (admin-editable announcement) */
.itsmd-mf-member-message {
    padding: 16px 20px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f7ff 100%);
    border: 1px solid #b8d4e8;
    border-left: 4px solid #0073aa;
    border-radius: 6px;
    color: #1e3a5f;
    font-size: 15px;
    line-height: 1.6;
}

.itsmd-mf-member-message p:first-child {
    margin-top: 0;
}

.itsmd-mf-member-message p:last-child {
    margin-bottom: 0;
}

.itsmd-mf-member-message a {
    color: #0056b3;
    text-decoration: underline;
}

.itsmd-mf-member-message a:hover {
    color: #003d80;
}

/* No access message */
.itsmd-mf-no-access {
    padding: 24px;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

/* Empty state */
.itsmd-mf-empty {
    padding: 48px 24px;
    text-align: center;
    color: #999;
}

.itsmd-mf-empty .itsmd-mf-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    color: #ccc;
}

.itsmd-mf-empty p {
    margin: 0;
    font-size: 15px;
}

/* Responsive: mobile */
@media (max-width: 600px) {
    .itsmd-mf-file-row {
        flex-wrap: wrap;
    }

    .itsmd-mf-file-info {
        flex-basis: calc(100% - 72px);
    }

    .itsmd-mf-file-meta {
        flex-wrap: wrap;
        gap: 6px;
    }

    .itsmd-mf-download-btn {
        margin-left: auto;
    }
}
