/* General Body and HTML Reset */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scroll as Three.js will manage camera movement */
    font-family: 'Montserrat', sans-serif;
    background-color: #0a0a0a; /* Dark background as specified */
    color: #f0f0f0;
    cursor: default;
}

/* Loading Screen Styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    opacity: 1;
    transition: opacity 1.5s ease-out;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none; /* Disable interaction after fade out */
}

.loading-text {
    font-size: 2.5em;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #e0e0e0;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeInText 2s forwards;
    animation-delay: 1s; /* Delay for cinematic fade-in */
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffd700; /* Gold accent */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    animation: fadeInSpinner 1.5s forwards;
    animation-delay: 0.5s;
}

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

@keyframes fadeInText {
    to { opacity: 1; }
}

@keyframes fadeInSpinner {
    to { opacity: 1; }
}

/* Canvas Styles */
#webgl-canvas {
    display: block; /* Remove any default canvas spacing */
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* Logo and Main Content Overlays */
.logo {
    position: fixed;
    top: 50px;
    left: 50px;
    font-size: 1.8em;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #ffd700; /* Gold accent for luxury feel */
    z-index: 10;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.logo.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-title {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em;
    font-weight: 200;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #e0e0e0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    z-index: 5;
    opacity: 0;
    transition: opacity 1s ease-out;
}

.gallery-title.visible {
    opacity: 1;
}

/* Object Detail Panel */
#object-detail {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 40%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #f0f0f0;
    padding: 20px;
    box-sizing: border-box;
    transform: translateY(100%);
    transition: transform 0.5s ease-out;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#object-detail.visible {
    transform: translateY(0);
}

#object-detail h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #ffd700;
    font-weight: 600;
    letter-spacing: 0.05em;
}

#object-detail p {
    font-size: 1.1em;
    line-height: 1.6;
    max-width: 800px;
    opacity: 0.8;
}

/* Outro Section */
#outro-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease-in, visibility 1.5s ease-in;
}

#outro-section.visible {
    opacity: 1;
    visibility: visible;
}

#outro-section h2 {
    font-size: 3em;
    color: #ffd700;
    margin-bottom: 20px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
}

#outro-section p {
    font-size: 1.2em;
    color: #e0e0e0;
    line-height: 1.5;
    max-width: 600px;
    text-align: center;
    margin-bottom: 30px;
}

.outro-cta {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(45deg, #ffd700, #ffeb3b);
    color: #0a0a0a;
    text-decoration: none;
    font-weight: 700;
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.outro-cta:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.5);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .logo {
        top: 20px;
        left: 20px;
        font-size: 1.2em;
    }

    .gallery-title {
        font-size: 2.5em;
    }

    .loading-text {
        font-size: 1.8em;
    }

    #object-detail h2 {
        font-size: 1.8em;
    }

    #object-detail p {
        font-size: 0.9em;
    }

    #outro-section h2 {
        font-size: 2em;
    }

    #outro-section p {
        font-size: 1em;
    }

    .outro-cta {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

