body { 
    padding: 0; 
    margin: 0; 
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#unity-container { 
    position: absolute;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#unity-canvas { 
    background: #000;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    max-width: 85%; /* Made smaller as requested */
    max-height: 85%; /* Made smaller as requested */
    min-width: 800px;
    min-height: 450px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Custom Loading Bar */
#unity-loading-bar { 
    position: absolute;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    display: flex !important; /* Force display initially */
    z-index: 1000;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); /* Fallback background */
    background-image: url('../../Background/LoadingBG.jpg'); /* Your background image */
    background-position: center center;
    background-size: cover; /* Changed to cover to fill the full screen */
    background-repeat: no-repeat;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Loading Container - Similar to Unity Canvas */
#unity-loading-container {
    background: rgba(0, 0, 0, 0.7); /* Darker background */
    border-radius: 20px; /* More rounded corners */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.15);
    padding: 50px; /* Increased padding for better spacing */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 85%; /* Match Unity canvas max-width */
    height: 85%; /* Match Unity canvas max-height */
    max-width: 85%; /* Match Unity canvas max-width */
    max-height: 85%; /* Match Unity canvas max-height */
    min-width: 800px; /* Match Unity canvas min-width */
    min-height: 450px; /* Match Unity canvas min-height */
    backdrop-filter: blur(15px); /* Increased blur effect */
    animation: containerFadeIn 0.8s ease-out;
    position: relative;
    overflow: hidden;
    margin: auto;
}

#unity-loading-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: shimmer 3s infinite;
}

@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

#unity-logo { 
    width: 300px; /* Increased from 200px to 300px */
    height: 300px; /* Increased from 200px to 300px */
    background: url('../../icons/icon-512x512.png') no-repeat center;
    background-size: contain;
    margin: 0 auto 40px;
    display: block;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    animation: logoFloat 3s ease-in-out infinite;
}

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

#unity-progress-bar-empty {
    width: 500px; /* Increased from 400px to 500px */
    height: 18px; /* Slightly taller */
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    overflow: hidden;
    margin: 25px 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

#unity-progress-bar-full {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #0099cc, #00d4ff); /* Changed back to blue theme */
    border-radius: 8px;
    transition: width 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
    animation: progressGlow 2s ease-in-out infinite alternate;
}

@keyframes progressGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.5); }
    50% { box-shadow: 0 0 30px rgba(0, 212, 255, 0.8); }
}

/* Loading Text */
#unity-loading-text {
    color: #ffffff;
    font-size: 26px; /* Slightly larger text */
    font-weight: 700; /* Bolder text */
    margin: 25px 0 35px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
    text-align: center;
    letter-spacing: 1px; /* Better letter spacing */
}

/* Custom Footer - Simplified */
#unity-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 12px 25px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
    /* Footer content removed as requested */
}

#unity-webgl-logo {
    width: 120px;
    height: 22px;
    background: url('webgl-logo.png') no-repeat center;
    background-size: contain;
    opacity: 0.7;
}

/* Warning Banner */
#unity-warning { 
    position: absolute;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    background: rgba(255, 193, 7, 0.9);
    color: #000;
    padding: 12px 25px;
    border-radius: 8px;
    display: none;
    z-index: 1001;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

/* Header - Moved to bottom */
#unity-header {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(0, 0, 0, 0.8) !important;
    padding: 15px 25px !important;
    border-radius: 25px !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    z-index: 9999 !important;
    top: auto !important;
}

/* Game Icon */
#unity-game-icon {
    width: 32px !important;
    height: 32px !important;
    background: url('../../icons/icon-512x512.png') no-repeat center !important;
    background-size: contain !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
    display: block !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Build Title */
#unity-build-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

/* Fullscreen Button */
#unity-fullscreen-button {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #ffffff;
    font-size: 16px;
    flex-shrink: 0;
}

#unity-fullscreen-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

#unity-fullscreen-button::before {
    content: "⛶";
}

/* Footer - Removed as requested */
#unity-footer {
    display: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    #unity-canvas {
        max-width: 90%;
        max-height: 90%;
    }
    
    #unity-header, #unity-footer {
        padding: 10px 20px !important;
        bottom: 20px !important;
        top: auto !important;
    }
}

@media (max-width: 768px) {
    #unity-canvas {
        max-width: 95%;
        max-height: 95%;
        min-width: 600px;
        min-height: 338px;
    }
    
    #unity-header, #unity-footer {
        padding: 8px 15px !important;
        bottom: 20px !important;
        top: auto !important;
    }
    
    #unity-build-title {
        font-size: 16px;
    }
}

/* Hide default Unity elements we don't want */
#unity-loading-bar:not([style*="display: block"]) {
    display: none !important;
}

/* Custom scrollbar for the page */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
