/* ============================================
   УЛУЧШЕННЫЙ ЗАГРУЗОЧНЫЙ ЭКРАН
   ============================================ */

.loading-screen-modern {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color-dark);
    z-index: 9999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

.loading-screen-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
}

.loading-logo-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-logo {
    font-size: 4rem;
    color: var(--primary-neon);
    text-shadow: 0 0 30px rgba(0, 191, 255, 0.8);
    animation: pulseGlow 2s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.loading-logo-ring {
    position: absolute;
    inset: -10px;
    border: 3px solid transparent;
    border-top-color: var(--primary-neon);
    border-right-color: var(--primary-neon);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.loading-logo-ring:nth-child(2) {
    inset: -20px;
    border-top-color: var(--secondary-neon);
    border-right-color: var(--secondary-neon);
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.loading-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #00BFFF 0%, #9400D3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

.loading-subtitle {
    font-size: 1rem;
    color: var(--text-color-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 0.5s ease-out 0.3s both;
}

/* Прогресс-бар */
.loading-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-neon) 0%, var(--secondary-neon) 100%);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.loading-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

.loading-progress-text {
    font-size: 0.875rem;
    color: var(--text-color-secondary);
    margin-top: 0.5rem;
    animation: fadeIn 0.3s ease-out 0.4s both;
}

/* Skeleton screens для dashboard */
.dashboard-skeleton {
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}

.skeleton-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    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: shimmer 1.5s ease-in-out infinite;
}

.skeleton-text {
    flex: 1;
    height: 20px;
    border-radius: 4px;
    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: shimmer 1.5s ease-in-out infinite;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.long {
    width: 100%;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.skeleton-button {
    height: 40px;
    border-radius: 8px;
    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: shimmer 1.5s ease-in-out infinite;
}

/* Анимация появления skeleton элементов */
.skeleton-card:nth-child(1) { animation-delay: 0.1s; }
.skeleton-card:nth-child(2) { animation-delay: 0.2s; }
.skeleton-card:nth-child(3) { animation-delay: 0.3s; }
.skeleton-card:nth-child(4) { animation-delay: 0.4s; }

/* Компактный загрузочный экран для переходов между страницами */
.loading-screen-compact {
    position: absolute;
    inset: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 16, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    animation: fadeInSmooth 0.3s ease-out;
    pointer-events: auto;
    opacity: 1 !important;
    transition: opacity 0.4s ease-out;
}

/* Плавное появление */
@keyframes fadeInSmooth {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.loading-screen-compact-content {
    text-align: center;
    padding: 1.5rem;
}

.loading-spinner-compact {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    position: relative;
}

.loading-spinner-compact::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid rgba(0, 191, 255, 0.2);
    border-top-color: var(--primary-neon, #00BFFF);
    border-right-color: var(--primary-neon, #00BFFF);
    border-radius: 50%;
    animation: rotateSmooth 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.5);
    will-change: transform;
}

/* Альтернативный спиннер через внутренний div (если ::before не работает) */
.loading-spinner-compact > div {
    position: absolute;
    inset: 0;
    border: 3px solid rgba(0, 191, 255, 0.2);
    border-top-color: #00BFFF;
    border-right-color: #00BFFF;
    border-radius: 50%;
    animation: rotateSmooth 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.5);
    will-change: transform;
}

/* Плавная анимация вращения */
@keyframes rotateSmooth {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading-text-compact {
    font-size: 0.95rem;
    color: var(--text-color-primary);
    animation: pulseSmooth 2.5s ease-in-out infinite;
    font-weight: 500;
    margin-top: 0.5rem;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
    will-change: opacity;
}

/* Плавная пульсация текста */
@keyframes pulseSmooth {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .loading-logo-container {
        width: 80px;
        height: 80px;
    }
    
    .loading-logo {
        font-size: 3rem;
    }
    
    .loading-title {
        font-size: 1.5rem;
    }
    
    .loading-subtitle {
        font-size: 0.9rem;
    }
    
    .dashboard-skeleton {
        padding: 1rem;
    }
    
    .skeleton-card {
        padding: 1rem;
    }
}

