/**
 * AutoMitra Loading System Styles
 * E-rickshaw themed loading overlay
 */

#global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#global-loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: white;
    padding: 40px;
    max-width: 90vw;
}

.loading-rickshaw {
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
}

.loading-rickshaw svg {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    animation: rickshaw-bounce 1.5s ease-in-out infinite, pulse 2s ease-in-out infinite;
}

.wheel-spin {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 16px;
}

.wheel {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2.5px solid #888;
    border-top-color: #fff;
    border-radius: 50%;
    animation: wheel-spin 0.8s linear infinite;
}

.wheel.front-wheel {
    left: 6px;
    bottom: 0;
}

.wheel.back-wheel {
    right: 6px;
    bottom: 0;
}

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

@keyframes rickshaw-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

.loading-text {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
}

.loading-subtext {
    font-size: 14px;
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

/* Disabled state for buttons during loading */
.loading-disabled {
    position: relative;
    pointer-events: none !important;
    opacity: 0.65;
    filter: grayscale(20%);
}

.loading-disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: not-allowed;
}

/* Loading indicator for inline actions */
.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #6f3b12;
    font-weight: 500;
}

.loading-inline::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #6f3b12;
    border-radius: 50%;
    animation: wheel-spin 0.8s linear infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .loading-content {
        padding: 24px;
    }
    
    .loading-rickshaw svg {
        width: 60px;
        height: 45px;
    }
    
    .wheel-spin {
        width: 45px;
        height: 12px;
    }
    
    .wheel {
        width: 12px;
        height: 12px;
    }
    
    .loading-text {
        font-size: 20px;
    }
    
    .loading-subtext {
        font-size: 12px;
    }
}