/* Container principal - Style SharePoint */
.spviewer-container {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background: #fff;
    border: 1px solid #edebe9;
    margin: 20px 0;
}

/* Breadcrumb de navigation */
.spviewer-breadcrumb {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: #faf9f8;
    border-bottom: 1px solid #edebe9;
    font-size: 14px;
}

.spviewer-breadcrumb-item {
    display: flex;
    align-items: center;
    color: #323130;
}

.spviewer-breadcrumb-link {
    color: #0078d4;
    text-decoration: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 2px;
}

.spviewer-breadcrumb-link:hover {
    background: #edebe9;
    text-decoration: underline;
}

.spviewer-breadcrumb-separator {
    margin: 0 4px;
    color: #605e5c;
}

.spviewer-breadcrumb-current {
    font-weight: 600;
    color: #323130;
}

/* En-tête du tableau */
.spviewer-table-header {
    display: grid;
    grid-template-columns: 40px 1fr 150px 180px;
    padding: 8px 20px;
    background: #faf9f8;
    border-bottom: 1px solid #edebe9;
    font-size: 12px;
    font-weight: 600;
    color: #323130;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spviewer-table-header-cell {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 4px 8px;
    border-radius: 2px;
}

.spviewer-table-header-cell:hover {
    background: #edebe9;
}

.spviewer-sort-icon {
    margin-left: 4px;
    opacity: 0.5;
    font-size: 10px;
}

.spviewer-table-header-cell.sorted .spviewer-sort-icon {
    opacity: 1;
    color: #0078d4;
}

/* Liste des fichiers */
.spviewer-list {
    display: flex;
    flex-direction: column;
}

.spviewer-item {
    display: grid;
    grid-template-columns: 40px 1fr 150px 180px;
    padding: 0 20px;
    min-height: 42px;
    align-items: center;
    border-bottom: 1px solid #f3f2f1;
    transition: background 0.1s ease;
    cursor: pointer;
}

.spviewer-item:hover {
    background: #f3f2f1;
}

.spviewer-item.selected {
    background: #deecf9;
}

/* Icône de fichier/dossier */
.spviewer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    width: 32px;
    height: 32px;
}

.spviewer-folder .spviewer-icon {
    color: #ffb900;
}

/* Nom du fichier */
.spviewer-name-cell {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 8px;
}

.spviewer-name {
    font-size: 14px;
    color: #0078d4;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}

.spviewer-name:hover {
    text-decoration: underline;
}

.spviewer-folder .spviewer-name {
    font-weight: 600;
    color: #323130;
}

/* Taille du fichier */
.spviewer-size-cell {
    font-size: 13px;
    color: #605e5c;
    padding: 8px;
}

/* Date de modification */
.spviewer-date-cell {
    font-size: 13px;
    color: #605e5c;
    padding: 8px;
}

/* Messages d'erreur et vide */
.spviewer-error {
    background: #fde7e9;
    border: 1px solid #a4262c;
    border-left: 4px solid #a4262c;
    padding: 16px 20px;
    color: #a4262c;
    margin: 20px;
    border-radius: 2px;
    font-size: 14px;
}

.spviewer-empty {
    text-align: center;
    padding: 60px 20px;
    color: #605e5c;
    font-size: 16px;
}

.spviewer-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Loader */
.spviewer-loading {
    text-align: center;
    padding: 40px;
    color: #605e5c;
}

.spviewer-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #f3f2f1;
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spviewer-spin 0.8s linear infinite;
}

@keyframes spviewer-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
    .spviewer-table-header,
    .spviewer-item {
        grid-template-columns: 40px 1fr 120px 140px;
    }
}

@media (max-width: 768px) {
    .spviewer-breadcrumb {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .spviewer-table-header {
        display: none;
    }
    
    .spviewer-item {
        grid-template-columns: 32px 1fr;
        padding: 12px;
        min-height: 56px;
    }
    
    .spviewer-size-cell,
    .spviewer-date-cell {
        display: none;
    }
    
    .spviewer-name-cell {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .spviewer-name {
        font-size: 15px;
    }
}

/* Icônes personnalisées pour types de fichiers */
.spviewer-icon.icon-folder::before { content: '📁'; }
.spviewer-icon.icon-pdf::before { content: '📄'; }
.spviewer-icon.icon-word::before { content: '📝'; }
.spviewer-icon.icon-excel::before { content: '📊'; }
.spviewer-icon.icon-powerpoint::before { content: '📊'; }
.spviewer-icon.icon-image::before { content: '🖼️'; }
.spviewer-icon.icon-archive::before { content: '📦'; }
.spviewer-icon.icon-text::before { content: '📃'; }
.spviewer-icon.icon-default::before { content: '📄'; }
