/* Skeleton Screens Styles */

/* Animation de pulse pour les skeletons */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Base skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #f8f8f8 50%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
    animation: skeleton-shimmer 2s infinite linear;
    border-radius: 4px;
}

/* Skeleton pour l'arborescence */
.skeleton-tree {
    padding: 20px;
}

.skeleton-tree-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.skeleton-tree-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.skeleton-tree-text {
    height: 16px;
    flex: 1;
    max-width: 200px;
}

.skeleton-tree-item.indent-1 {
    padding-left: 20px;
}

.skeleton-tree-item.indent-2 {
    padding-left: 40px;
}

/* Skeleton pour la liste de fichiers */
.skeleton-file-list {
    padding: 20px;
}

.skeleton-file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    gap: 12px;
    background: white;
    border-radius: 6px;
}

.skeleton-file-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
}

.skeleton-file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-file-name {
    height: 16px;
    width: 60%;
}

.skeleton-file-meta {
    height: 12px;
    width: 30%;
}

/* Skeleton pour la grille de fichiers */
.skeleton-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
}

.skeleton-grid-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.skeleton-grid-icon {
    width: 100%;
    height: 120px;
    border-radius: 6px;
}

.skeleton-grid-text {
    height: 14px;
    width: 80%;
}

/* Skeleton pour la prévisualisation */
.skeleton-preview {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    gap: 15px;
}

.skeleton-preview-header {
    display: flex;
    gap: 12px;
    align-items: center;
}

.skeleton-preview-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    flex-shrink: 0;
}

.skeleton-preview-title {
    flex: 1;
}

.skeleton-preview-title-text {
    height: 20px;
    width: 70%;
    margin-bottom: 8px;
}

.skeleton-preview-subtitle {
    height: 14px;
    width: 40%;
}

.skeleton-preview-content {
    flex: 1;
    border-radius: 8px;
}

.skeleton-preview-actions {
    display: flex;
    gap: 10px;
    padding: 15px 0;
}

.skeleton-preview-button {
    width: 100px;
    height: 36px;
    border-radius: 6px;
}

/* Skeleton pour le chargement initial */
.skeleton-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f5;
    display: flex;
    z-index: 9999;
}

.skeleton-loading-overlay.hidden {
    display: none;
}

.skeleton-sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
}

.skeleton-main {
    flex: 1;
    padding: 20px;
}

.skeleton-logo {
    width: 150px;
    height: 40px;
    margin-bottom: 30px;
}

/* Skeleton spécifique pour le chargement du filesystem */
.skeleton-filesystem-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.skeleton-filesystem-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.skeleton-filesystem-text {
    height: 20px;
    width: 200px;
}

.skeleton-filesystem-subtext {
    height: 14px;
    width: 150px;
}

/* Skeleton pour les cards */
.skeleton-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.skeleton-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.skeleton-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card-title {
    flex: 1;
}

.skeleton-card-title-text {
    height: 18px;
    width: 60%;
    margin-bottom: 6px;
}

.skeleton-card-subtitle {
    height: 14px;
    width: 40%;
}

.skeleton-card-content {
    height: 80px;
    margin-bottom: 15px;
}

.skeleton-card-actions {
    display: flex;
    gap: 10px;
}

.skeleton-card-action {
    width: 80px;
    height: 32px;
}

/* Variations de couleur pour différents états */
.skeleton.dark {
    background: linear-gradient(
        90deg,
        #e0e0e0 0%,
        #e8e8e8 50%,
        #e0e0e0 100%
    );
    background-size: 1000px 100%;
}

.skeleton.light {
    background: linear-gradient(
        90deg,
        #f8f8f8 0%,
        #ffffff 50%,
        #f8f8f8 100%
    );
    background-size: 1000px 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .skeleton-file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .skeleton-loading-overlay .skeleton-sidebar {
        width: 200px;
    }
}
