/**
 * Kerjakode Professional Loader
 * Minimal Line Spinner - Agency Grade Design
 */

.loader-wrapper {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-wrapper.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(10, 143, 136, 0.25);
    border-top-color: #0A8F88;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

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

/* Optional: Loader with brand text */
.loader-with-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-text {
    color: #0A8F88;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .loader {
        width: 36px;
        height: 36px;
        border-width: 2.5px;
    }
    
    .loader-text {
        font-size: 14px;
    }
}

/* Alternative: Dots loader (backup option) */
.loader-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.loader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0A8F88;
    animation: dot-bounce 1.4s ease-in-out infinite both;
}

.loader-dot:nth-child(1) { animation-delay: -0.32s; }
.loader-dot:nth-child(2) { animation-delay: -0.16s; }
.loader-dot:nth-child(3) { animation-delay: 0s; }

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

/* Page transition loader (for SPA-like experience) */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(10, 143, 136, 0.1);
    z-index: 9998;
    overflow: hidden;
}

.page-loader-bar {
    height: 100%;
    background: #0A8F88;
    width: 0%;
    animation: page-load 2s ease-in-out;
}

@keyframes page-load {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Smooth page transitions */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-transition.loaded {
    opacity: 1;
    transform: translateY(0);
}