/**
 * Skeleton Loaders для всего проекта
 * Этап 6.1: Loading States
 * 
 * Skeleton loaders для виджетов, списков и элементов интерфейса
 */

/* ==================== БАЗОВЫЙ SKELETON ==================== */

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeletonLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==================== SKELETON ВИДЖЕТОВ ==================== */

.skeleton-widget {
    padding: 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.skeleton-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.skeleton-widget-title {
    width: 60%;
    height: 24px;
    border-radius: 6px;
}

.skeleton-widget-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.skeleton-widget-content {
    margin-top: 16px;
}

.skeleton-widget-line {
    height: 16px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-widget-line:last-child {
    margin-bottom: 0;
    width: 70%;
}

/* ==================== SKELETON КАРТОЧЕК ==================== */

.skeleton-card {
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

.skeleton-card-title {
    flex: 1;
    height: 20px;
    border-radius: 4px;
}

.skeleton-card-content {
    margin-top: 12px;
}

.skeleton-card-line {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-card-line:last-child {
    width: 60%;
}

/* ==================== SKELETON СПИСКОВ ==================== */

.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.skeleton-list-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-list-content {
    flex: 1;
}

.skeleton-list-title {
    width: 70%;
    height: 16px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-list-subtitle {
    width: 50%;
    height: 14px;
    border-radius: 4px;
}

/* ==================== SKELETON ТАБЛИЦ ==================== */

.skeleton-table {
    width: 100%;
    border-collapse: collapse;
}

.skeleton-table-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.skeleton-table-cell {
    padding: 16px;
    height: 20px;
    border-radius: 4px;
}

/* ==================== SKELETON СТАТИСТИКИ ==================== */

.skeleton-stat {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.skeleton-stat-value {
    width: 80px;
    height: 32px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.skeleton-stat-label {
    width: 120px;
    height: 14px;
    border-radius: 4px;
}

/* ==================== SPINNER ДЛЯ КНОПОК ==================== */

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== SPINNER ОБЩИЙ ==================== */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

.spinner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ==================== LOADING OVERLAY ==================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    color: white;
}

.loading-overlay-spinner {
    width: 50px;
    height: 50px;
}

.loading-overlay-text {
    font-size: 1.1rem;
    font-weight: 500;
}

/* ==================== АДАПТИВНОСТЬ ==================== */

@media (max-width: 768px) {
    .skeleton-widget {
        padding: 16px;
    }
    
    .skeleton-card {
        padding: 12px;
    }
    
    .skeleton-list-item {
        padding: 10px;
    }
}

