/* Loading Overlay - Global */
#global-loading {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.2s ease;
    pointer-events: none; /* permite clicar por baixo quando for toast */
}

/* Mostrar o loading */
#global-loading.show {
    display: flex;
}

/* Posição central: tela inteira */
#global-loading.center {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

/* Posições nos cantos: tamanho automático, posicionadas no canto */
#global-loading.left-top {
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 16px;
    background-color: transparent; /* remove máscara nos cantos */
}

#global-loading.right-top {
    top: 0;
    right: 0;
    width: auto;
    height: auto;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 16px;
    background-color: transparent;
}

#global-loading.left-bottom {
    bottom: 0;
    left: 0;
    width: auto;
    height: auto;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 16px;
    background-color: transparent;
}

#global-loading.right-bottom {
    bottom: 0;
    right: 0;
    width: auto;
    height: auto;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 16px;
    background-color: transparent;
}

/* Conteúdo do loading */
#global-loading .loading-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #ffffff;
    background: #1f1f1f;
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Estilo Toast para cantos */
#global-loading.left-top .loading-content,
#global-loading.right-top .loading-content,
#global-loading.left-bottom .loading-content,
#global-loading.right-bottom .loading-content {
    background: #1f1f1f;
    padding: 8px 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    font-size: 12.5px;
}

#global-loading.center .loading-content {
    background: #1f1f1f;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#global-loading .loading-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

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