/* Preloader Styles */
.preloader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    color: #f8fafc;
    max-width: 500px;
    padding: 20px;
}

.preloader-logo {
    font-size: 48px;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.preloader-title {
    font-size: 32px;
    font-weight: bold;
    color: #fcd34d;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(252, 211, 77, 0.5);
}

.preloader-subtitle {
    font-size: 16px;
    color: #94a3b8;
    margin-bottom: 30px;
}

.preloader-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.preloader-bar {
    height: 100%;
    background: linear-gradient(90deg, #fcd34d, #f9c22e, #fcd34d);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
    box-shadow: 0 0 10px rgba(252, 211, 77, 0.5);
}

.preloader-percentage {
    font-size: 24px;
    font-weight: bold;
    color: #fcd34d;
    margin-bottom: 10px;
}

.preloader-status {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 5px;
    min-height: 20px;
}

.preloader-resource {
    font-size: 12px;
    color: #64748b;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.preloader-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(252, 211, 77, 0.2);
    border-radius: 50%;
    border-top-color: #fcd34d;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.preloader-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    color: #ef4444;
    font-size: 14px;
    line-height: 1.6;
}

.preloader-error-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 16px;
}

.preloader-error-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    max-height: 150px;
    overflow-y: auto;
}

.preloader-error-list li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.preloader-error-list li:last-child {
    border-bottom: none;
}

.preloader-retry-button {
    margin-top: 15px;
    padding: 10px 20px;
    background: #fcd34d;
    color: #0f172a;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.preloader-retry-button:hover {
    background: #f9c22e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(252, 211, 77, 0.3);
}

.preloader-continue-button {
    margin-top: 10px;
    padding: 10px 20px;
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.preloader-continue-button:hover {
    background: rgba(148, 163, 184, 0.3);
    transform: translateY(-2px);
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .preloader-content {
        padding: 15px;
        max-width: 90%;
    }

    .preloader-title {
        font-size: 24px;
    }

    .preloader-subtitle {
        font-size: 14px;
    }

    .preloader-logo {
        font-size: 36px;
    }

    .preloader-percentage {
        font-size: 20px;
    }

    .preloader-error {
        font-size: 12px;
    }
}