/* ========================================
   Shared / Favorites / Trash Views
   ======================================== */

.shared-view-container {
    display: block;
}

.shared-file-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

/* Shared List Table Header */
.shared-list-header {
    display: grid;
    grid-template-columns: 48px 1fr 160px 160px 48px;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: transparent;
    box-sizing: border-box;
}

/* Shared List Item */
.shared-file-item {
    display: grid;
    grid-template-columns: 48px 1fr 160px 160px 48px; 
    width: 100%;
    min-height: 56px;
    padding: 10px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    text-align: left;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

.shared-file-item:last-child {
    border-bottom: none;
}

.shared-file-item:hover {
    background-color: var(--hover-bg);
}

.shared-file-item .col-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.shared-file-item .col-icon svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.shared-file-item .col-name {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 16px;
    min-width: 0;
}

.shared-file-item .file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.shared-file-item .file-path-hint {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.shared-file-item .col-size,
.shared-file-item .col-date {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
}

.shared-file-item .col-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.shared-file-item:hover .col-actions {
    opacity: 1;
}

@media (max-width: 768px) {
    .shared-list-header,
    .shared-file-item {
        grid-template-columns: 40px 1fr 100px 40px;
        padding: 10px 8px;
    }
    
    .shared-list-header > *:nth-child(4),
    .shared-file-item > *:nth-child(4) {
        display: none;
    }

    .shared-file-item .col-actions {
        opacity: 1;
    }
}

/* Empty State (Generic) */
/* Note: Also defined in file-list.css but repeated here for completeness/fallback */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    color: var(--text-secondary);
    text-align: center;
    /* Grid column property is safe to include even if not in grid */
    grid-column: 1 / -1; 
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

.shares-list,
.favorites-list,
.trash-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-light);
}

.share-item,
.favorite-item,
.trash-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition);
}

.share-item:hover,
.favorite-item:hover,
.trash-item:hover {
    background: var(--hover-bg);
}

.share-item.expired {
    opacity: 0.5;
}

.share-icon,
.favorite-icon,
.trash-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.share-info,
.favorite-info,
.trash-info {
    flex: 1;
    min-width: 0;
}

.share-name,
.favorite-name,
.trash-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-path,
.favorite-path,
.trash-path {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-meta,
.favorite-meta,
.trash-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.share-actions,
.favorite-actions,
.trash-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.trash-toolbar {
    padding: 12px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

.error {
    color: var(--danger);
    text-align: center;
    padding: 24px;
}

/* ========================================
   Tags File List (with Thumbnail)
   ======================================== */

.tags-file-list .shared-list-header,
.tags-file-list .shared-file-item {
    grid-template-columns: 48px 1fr 100px 140px 100px;
}

.col-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.tag-file-thumbnail {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: var(--bg-secondary);
    -webkit-user-drag: none;
    user-select: none;
}

.thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.thumbnail-placeholder svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.tags-file-list .col-actions {
    display: flex;
    gap: 2px;
    justify-content: flex-end;
    min-width: 100px;
}

.tags-file-list .col-actions .btn-icon {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.tags-file-list .shared-file-item:hover .col-actions .btn-icon {
    opacity: 1;
}

@media (max-width: 768px) {
    .tags-file-list .shared-list-header,
    .tags-file-list .shared-file-item {
        grid-template-columns: 40px 1fr 80px;
        padding: 8px;
    }
    
    .tags-file-list .col-size,
    .tags-file-list .col-date {
        display: none;
    }
    
    .col-thumbnail {
        width: 32px;
        height: 32px;
    }
    
    .tag-file-thumbnail,
    .thumbnail-placeholder {
        width: 28px;
        height: 28px;
    }

    .tags-file-list .col-actions {
        opacity: 1;
        min-width: 70px;
    }
}
