:root {
    --primary: #8a2be2;
    --primary-light: #9d4edd;
    --secondary: #219ebc;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --light: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(15, 23, 42, 0.8);
    --shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark);
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 70px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

#navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-light);
}

/* Demo Layout */
.demo-container {
    padding-top: 120px;
    padding-bottom: 60px;
    min-height: calc(100vh - 70px - 100px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.demo-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-align: center;
    background: linear-gradient(to right, #fff, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.demo-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* Upload Zone */
.upload-zone {
    width: 100%;
    max-width: 600px;
    height: 300px;
    border: 2px dashed #4b5563;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(30, 41, 59, 0.5);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary-light);
    background: rgba(138, 43, 226, 0.1);
}

.upload-content {
    text-align: center;
    pointer-events: none;
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.upload-zone:hover .upload-icon {
    color: var(--primary-light);
}

.upload-content p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.upload-content span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.status-msg {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Result Section */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

/* Visibility Helpers */
.hidden {
    display: none !important;
}

.active {
    display: block;
}

/* Re-using and adjusting existing styles */
.section { padding: 4rem 0; }
.shadow { box-shadow: var(--shadow); }

.demo-viewport {
    width: 100vw;
    max-width: 1000px;
    height: 600px;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
}

#demo-canvas-container {
    width: 100%;
    height: 100%;
}

.demo-ui {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}

.legend {
    background: rgba(0,0,0,0.6);
    padding: 1rem;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.chair { background: #ff595e; }
.table { background: #8ac926; }
.floor { background: #1982c4; }
.wall { background: #6a4c93; }

.controls-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    background: rgba(0,0,0,0.6);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* Results */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.comparison-item h3 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--secondary);
}

.image-pair {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comparison-item .label {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* BibTeX */
.bibtex-container {
    background: #111;
    padding: 2rem;
    border-radius: 12px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#bibtex-code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: #aeaeae;
    overflow-x: auto;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

/* Footer */
.footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .title { font-size: 2.5rem; }
    .comparison-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}
