/* Loader styles using our design system */

#saiap-loader {
    display: none;
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
    padding: 20px;
    margin: 20px 0;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    opacity: 0;
}

#saiap-loader.is-active {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    opacity: 1;
}

.loader-content {
    margin-left: 16px;
}

.loader-content p {
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 24px;
    color: var(--text-primary);
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--neutral-border);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media screen and (max-width: 576px) {
    #saiap-loader {
        padding: 16px;
        margin: 16px 0;
    }
    
    .loader-content p {
        font-size: 14px;
        line-height: 20px;
    }
}

/* Skeleton loader for site context */
.saiap-skeleton-loader {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.saiap-skeleton-loader .skeleton-line {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.saiap-skeleton-loader .skeleton-line:nth-child(2n) {
    width: 90%;
}

.saiap-skeleton-loader .skeleton-line:nth-child(3n) {
    width: 80%;
}

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