/* Loading Component Styles */
.loading-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Progress Bar no Topo */
.loading-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #f3e7f3, #e1bee7);
    overflow: hidden;
}

.loading-progress-fill {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #9c27b0, #e91e63, #ff4081, #9c27b0);
    background-size: 200% 100%;
    animation: progressMove 1.5s ease-in-out infinite;
    border-radius: 0 2px 2px 0;
}

@keyframes progressMove {
    0% {
        transform: translateX(-100%);
        background-position: 200% 0;
    }
    50% {
        background-position: 0% 0;
    }
    100% {
        transform: translateX(400%);
        background-position: -200% 0;
    }
}

/* Conteúdo Central */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Spinner Animado */
.loading-spinner {
    display: flex;
    gap: 8px;
    align-items: center;
}

.loading-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(45deg, #9c27b0, #e91e63);
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-circle:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-circle:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-circle:nth-child(3) {
    animation-delay: 0s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Texto do Loading */
.loading-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #6a1b9a;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Variação para Loading Inline (sem overlay) */
.loading-inline {
    position: relative !important;
    background: transparent !important;
    backdrop-filter: none !important;
    height: auto !important;
    width: auto !important;
    padding: 20px;
}

.loading-inline .loading-progress-bar {
    position: relative;
    margin-bottom: 20px;
    border-radius: 2px;
}

.loading-inline .loading-content {
    gap: 16px;
}

.loading-inline .loading-text {
    font-size: 14px;
}

/* Responsivo */
@media (max-width: 768px) {
    .loading-text {
        font-size: 14px;
    }
    
    .loading-circle {
        width: 10px;
        height: 10px;
    }
    
    .loading-progress-bar {
        height: 3px;
    }
}

/* Estados do Loading */
.loading-overlay.loading-fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Loading para iframes específicos */
.iframe-loading-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px; /* Altura mínima para o content */
}

.iframe-loading-overlay {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.iframe-loading-overlay .loading-progress-bar {
    top: 0;
    height: 3px;
}

.iframe-loading-overlay .loading-content {
    gap: 16px;
}

.iframe-loading-overlay .loading-text {
    font-size: 14px;
    color: #7b1fa2;
}

.iframe-loading-overlay .loading-circle {
    width: 8px;
    height: 8px;
}

/* Animação de entrada suave */
.loading-overlay.loading-show {
    animation: loadingShow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes loadingShow {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Estilos específicos para o content loading */
#contentLoadingOverlay {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    border-radius: 8px;
/*    margin: 8px;*/
}

#contentLoadingOverlay .loading-progress-bar {
    border-radius: 8px 8px 0 0;
}

#contentLoadingOverlay .loading-text {
    color: #7b1fa2;
    font-size: 15px;
}

#contentLoadingOverlay .loading-circle {
    width: 10px;
    height: 10px;
}

/* Ajustes para o container principal */
/*#mainContent {*/
/*    overflow: hidden;*/
/*}*/

#mainContent iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}
