/* Modern Splash Screen for COMCAM */
body fuse-splash-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1B5E20 0%, #2E8B67 50%, #4CAF50 100%);
    color: #F9FAFB;
    z-index: 999999;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

body:not(.fuse-splash-screen-hidden) {
    overflow: hidden;
}

body.fuse-splash-screen-hidden fuse-splash-screen {
    visibility: hidden;
    opacity: 0;
}

/* Main Container */
.splash-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 600px;
    padding: 20px;
}

/* Title Styles */
.comcam-text {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: 8px;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 0.8s ease-out;
}

.comcam-subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 2px;
    margin: 0;
    color: #E8F5E9;
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* Circle Container with Animation */
.circle-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInScale 1s ease-out 0.4s backwards;
}

.animated-circle {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animated Border */
.circle-border {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #4CAF50;
    border-right-color: #81C784;
    animation: spin 2s linear infinite;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.4);
}

.circle-border::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: spin 3s linear infinite reverse;
}

/* Circle Content */
.circle-content {
    position: relative;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
                inset 0 0 20px rgba(76, 175, 80, 0.1);
    animation: pulse 2s ease-in-out infinite;
}

/* Truck GIF */
.truck-gif {
    width: 220px;
    height: 220px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

/* Progress Bar Container */
.progress-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

.progress-bar-wrapper {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.progress-bar {
    height: 100%;
    width: 5%;
    background: linear-gradient(90deg, #4CAF50 0%, #81C784 50%, #A5D6A7 100%);
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
    position: relative;
    overflow: hidden;
    /* Optimized for smooth JS-driven animation */
    will-change: width;
    transform: translateZ(0); /* Enable hardware acceleration */
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
    transform: translateX(-100%);
    will-change: transform;
}

.progress-text {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

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

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

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .splash-container {
        gap: 30px;
        padding: 15px;
    }

    .comcam-text {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }

    .comcam-subtitle {
        font-size: 0.9rem;
        letter-spacing: 1px;
        padding: 0 10px;
    }

    .animated-circle {
        width: 220px;
        height: 220px;
    }

    .circle-content {
        width: 190px;
        height: 190px;
    }

    .truck-gif {
        width: 170px;
        height: 170px;
    }

    .progress-container {
        max-width: 320px;
    }

    .progress-bar-wrapper {
        height: 6px;
    }

    .progress-text {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .splash-container {
        gap: 25px;
        padding: 10px;
    }

    .comcam-text {
        font-size: 2rem;
        letter-spacing: 3px;
    }

    .comcam-subtitle {
        font-size: 0.8rem;
        letter-spacing: 0.5px;
        padding: 0 15px;
        line-height: 1.3;
    }

    .animated-circle {
        width: 180px;
        height: 180px;
    }

    .circle-content {
        width: 155px;
        height: 155px;
    }

    .truck-gif {
        width: 135px;
        height: 135px;
    }

    .circle-border {
        border-width: 3px;
    }

    .progress-container {
        max-width: 280px;
        gap: 10px;
    }

    .progress-bar-wrapper {
        height: 6px;
    }

    .progress-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 360px) {
    .comcam-text {
        font-size: 1.75rem;
        letter-spacing: 2px;
    }

    .comcam-subtitle {
        font-size: 0.75rem;
    }

    .animated-circle {
        width: 150px;
        height: 150px;
    }

    .circle-content {
        width: 130px;
        height: 130px;
    }

    .truck-gif {
        width: 115px;
        height: 115px;
    }

    .progress-container {
        max-width: 240px;
    }
}

/* Landscape orientation for mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .splash-container {
        gap: 15px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }

    .comcam-text {
        font-size: 1.5rem;
        width: 100%;
        text-align: center;
    }

    .comcam-subtitle {
        font-size: 0.7rem;
        width: 100%;
        text-align: center;
    }

    .animated-circle {
        width: 120px;
        height: 120px;
    }

    .circle-content {
        width: 100px;
        height: 100px;
    }

    .truck-gif {
        width: 85px;
        height: 85px;
    }

    .progress-container {
        max-width: 250px;
        margin-top: 10px;
    }
}
