/* frontend/static/css/creative_studio/initial-loading.css */

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

/* Esconder conteúdo durante loading inicial */
body.cs-loading-initial .cs-container {
    opacity: 0;
    visibility: hidden;
}

/* Overlay de Loading Inicial */
.cs-initial-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.cs-initial-loading.active {
    opacity: 1;
    pointer-events: all;
}

.cs-initial-loading.fade-out {
    opacity: 0;
}

/* Conteúdo do Loading */
.cs-initial-loading-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo/Ícone Animado */
.cs-loading-logo {
    margin-bottom: 24px;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Título */
.cs-loading-title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mensagem */
.cs-loading-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin: 0 0 32px 0;
    font-weight: 400;
}

/* Barra de Progresso */
.cs-loading-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 32px;
}

.cs-loading-progress-bar {
    height: 100%;
    background: white;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Dicas */
.cs-loading-tips {
    margin-top: 32px;
}

.cs-loading-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin: 0;
    animation: fadeInOut 4s ease infinite;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

.cs-loading-tip i {
    font-size: 16px;
    color: white;
}

/* Variação para tema claro */
body:not(.dark) .cs-initial-loading {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Animação de pontos de carregamento */
.cs-loading-dots {
    display: inline-block;
}

.cs-loading-dots::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .cs-initial-loading-content {
        padding: 24px;
        max-width: 90%;
    }
    
    .cs-loading-title {
        font-size: 24px;
    }
    
    .cs-loading-message {
        font-size: 14px;
    }
    
    .cs-loading-logo svg {
        width: 60px;
        height: 60px;
    }
}

/* Prevenção de FOUC */
.cs-container {
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

body:not(.cs-loading-initial) .cs-container {
    opacity: 1;
    visibility: visible;
}

/* Skeleton loading para elementos críticos */
.cs-skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 25%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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