/* Loading Panel Styles - Based on Homepage_SPAC_VISION_2.jpg */

.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    overflow: hidden;
}

.loading-container.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Geometric background pattern */
.loading-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, rgba(83, 104, 120, 0.03) 1px, transparent 1px),
        linear-gradient(-45deg, rgba(83, 104, 120, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(83, 104, 120, 0.02) 1px, transparent 1px),
        linear-gradient(0deg, rgba(83, 104, 120, 0.02) 1px, transparent 1px);
    background-size: 60px 60px, 60px 60px, 30px 30px, 30px 30px;
    background-position: 0 0, 0 0, 0 0, 0 0;
    animation: backgroundMove 20s linear infinite;
    opacity: 0.6;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* Main content container */
.loading-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

/* SPAC VISION Logo */
.loading-logo {
    margin-bottom: 60px;
    animation: logoFadeIn 1s ease-out;
}

.loading-logo img {
    max-width: 400px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

@keyframes logoFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress section */
.loading-progress {
    width: 100%;
    max-width: 400px;
    margin-bottom: 40px;
}

/* Progress bar container */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background-color: rgba(83, 104, 120, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Progress bar fill */
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c 0%, #3498db 100%);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Progress text */
.progress-text {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    color: #536878;
    font-weight: 500;
    margin-bottom: 8px;
    min-height: 24px;
    animation: textFade 0.3s ease-in-out;
}

@keyframes textFade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.progress-percentage {
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 400;
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 3px solid rgba(83, 104, 120, 0.2);
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Powered by Utopia */
.loading-footer {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: footerFadeIn 1.5s ease-out;
}

.loading-footer img {
    max-width: 200px;
    height: auto;
    opacity: 0.8;
    filter: grayscale(20%);
}

@keyframes footerFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    100% {
        opacity: 0.8;
        transform: translateX(-50%) translateY(0);
    }
}

/* Error Screen Styles */
.error-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.error-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 500px;
    padding: 40px;
}

.error-logo {
    margin-bottom: 40px;
    opacity: 0.7;
}

.error-logo img {
    max-width: 300px;
    height: auto;
    filter: grayscale(50%);
}

.error-message {
    font-family: 'Arial', sans-serif;
    font-size: 24px;
    color: #e74c3c;
    font-weight: 600;
    margin-bottom: 16px;
}

.error-description {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    color: #536878;
    line-height: 1.5;
    margin-bottom: 30px;
}

.error-retry-btn {
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.error-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

.error-retry-btn:active {
    transform: translateY(0);
}

/* Responsive design */
@media (max-width: 768px) {
    .loading-content {
        padding: 20px;
        max-width: 90%;
    }
    
    .loading-logo img {
        max-width: 280px;
    }
    
    .loading-footer {
        bottom: 20px;
    }
    
    .loading-footer img {
        max-width: 150px;
    }
    
    .error-content {
        padding: 20px;
        max-width: 90%;
    }
    
    .error-logo img {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .loading-logo img {
        max-width: 240px;
    }
    
    .progress-text {
        font-size: 14px;
    }
    
    .loading-footer img {
        max-width: 120px;
    }
    
    .error-message {
        font-size: 20px;
    }
    
    .error-description {
        font-size: 14px;
    }
}

/* Hidden class for initial state */
.hidden {
    display: none !important;
}
