/* -------------------------------------------------------------
   3D Floorplan Walkthrough Stylesheet
   Theme: Luxury Champaign Gold & Sleek Glassmorphism
------------------------------------------------------------- */

:root {
    --bg-primary: #0a0b0d;
    --panel-bg: rgba(15, 17, 21, 0.7);
    --panel-border: rgba(255, 255, 255, 0.06);
    --accent: #dfb774; /* Luxury Champagne Gold */
    --accent-glow: rgba(223, 183, 116, 0.35);
    --text-main: #f0f2f5;
    --text-muted: #9fa6b2;
    --shadow-premium: 0 16px 40px rgba(0, 0, 0, 0.5);
    --font-stack: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-drag: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(circle at center, #1b2234 0%, #06070a 100%);
    font-family: var(--font-stack);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* 3D Canvas */
#canvas-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* UI Overlay Container */
#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to canvas where needed */
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    grid-template-rows: 80px 1fr 60px 80px;
    grid-template-areas: 
        "header header header"
        "sidebar content cost"
        "sidebar timeline cost"
        "sidebar footer cost";
    padding: 24px;
    gap: 20px;
}

/* Glassmorphic Panel Base */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: var(--shadow-premium);
    pointer-events: auto; /* Re-enable pointer events for UI interaction */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

/* --- Top Header --- */
.main-header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: 100%;
}

.logo-area {
    display: flex;
    flex-direction: column;
}

.logo-area h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 2px;
}

.badge {
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.area-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-top: 1px;
}

.header-divider {
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent);
    margin: 0 40px;
}

.view-selector {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.view-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    padding: 10px 18px;
    border-radius: 8px;
    font-family: var(--font-stack);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn svg {
    transition: transform 0.2s ease;
}

.view-btn:hover {
    color: var(--text-main);
}

.view-btn.active {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(223, 183, 116, 0.3);
}

.view-btn.active svg {
    transform: scale(1.1);
}

.mobile-only-btn {
    display: none !important;
}

/* --- Sidebar Room Inspector --- */
#room-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    padding: 28px;
    height: 100%;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.icon-btn:hover {
    color: #ff5e5e;
}

#room-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#room-details h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.dimension-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.dimension-row .label {
    color: var(--text-muted);
}

.dimension-row .value {
    font-weight: 500;
    color: var(--accent);
}

#room-desc {
    font-size: 0.92rem;
    color: var(--text-main);
    font-weight: 500;
    line-height: 1.6;
    margin-top: 12px;
    margin-bottom: 24px;
}

.feature-section h3 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-main);
    margin-bottom: 12px;
    text-transform: uppercase;
}

#room-features {
    list-style: none;
}

#room-features li {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    position: relative;
    padding-left: 18px;
    margin-bottom: 8px;
    line-height: 1.4;
}

#room-features li::before {
    content: "•";
    color: var(--accent);
    font-size: 1.1rem;
    position: absolute;
    left: 2px;
    top: -2px;
}

.navigation-hints {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
}

.hint-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-main);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.control-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.control-row span:last-child {
    color: var(--text-muted);
    text-align: right;
}

.key {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: monospace;
    font-weight: bold;
    color: var(--accent);
}

/* --- Quick Tour Navigator (Bottom Center) --- */
.quick-nav {
    grid-area: footer;
    align-self: end;
    display: flex;
    align-items: center;
    padding: 14px 24px;
    width: fit-content;
    margin: 0 auto;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent);
    margin-right: 16px;
}

.nav-buttons {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.nav-room-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font-stack);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-room-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.nav-room-btn.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

/* --- Environment Controls (Floating Right) --- */
.env-controls {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    pointer-events: auto;
}

.control-toggle {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.control-toggle span {
    position: absolute;
    right: 56px;
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-family: var(--font-stack);
    color: var(--text-main);
    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.control-toggle:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.control-toggle:hover span {
    opacity: 1;
    transform: translateX(0);
}

.control-toggle.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

.hidden {
    display: none !important;
}

/* Walkthrough HUD helper overlay */
#walkthrough-helper {
    position: absolute;
    top: 110px;
    right: 24px;
    background: rgba(15, 17, 21, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.8rem;
    pointer-events: none;
    animation: fadeIn 0.5s ease forwards;
    z-index: 5;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

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

/* Interactive Glowing Hotspot styling in HTML (using CSS2D if we want, or in-canvas sprites).
   For absolute performance and compatibility, we render 3D glowing meshes, but we can style their look. */

/* Scrollbar Customization */
#room-sidebar::-webkit-scrollbar {
    width: 6px;
}
#room-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
#room-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
#room-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- 5D Cost Estimator Sidebar --- */
#cost-sidebar {
    grid-area: cost;
    display: flex;
    flex-direction: column;
    padding: 28px;
    height: 100%;
    overflow-y: auto;
}

.price-header {
    text-align: center;
    background: rgba(0,0,0,0.2);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
    margin-bottom: 24px;
}

.price-header h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.price-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 12px var(--accent-glow);
}

.price-subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.upgrade-section h4 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-main);
    text-transform: uppercase;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.upgrade-option {
    margin-bottom: 16px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 32px;
    cursor: pointer;
    font-size: 0.85rem;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: rgba(255,255,255,0.1);
    border-color: var(--accent);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.option-details {
    display: flex;
    flex-direction: column;
}

.option-title {
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.85rem;
}

.option-price {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
}

.flat-spec-summary {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 20px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.spec-row span:last-child {
    color: var(--text-main);
    font-weight: 600;
}

/* --- 4D Construction Timeline --- */
#timeline-container {
    grid-area: timeline;
    align-self: center;
    display: flex;
    align-items: center;
    padding: 12px 28px;
    width: fit-content;
    margin: 0 auto;
    gap: 18px;
    border-radius: 12px;
    background: rgba(10, 11, 13, 0.9); /* Opaque dark background for high contrast */
    border: 1.5px solid var(--accent); /* Elegant Champagne Gold outline */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.timeline-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent);
}

.timeline-slider-wrapper {
    display: flex;
    flex-direction: column;
    width: 320px;
    gap: 4px;
    pointer-events: auto;
}

#timeline-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.15);
    outline: none;
    cursor: pointer;
}

#timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    cursor: pointer;
    transition: transform 0.1s ease;
}

#timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem; /* Larger font size */
    color: #ffffff; /* Faint grey replaced with bright white */
    font-weight: 600; /* Bolder letters */
    margin-top: 2px;
}

.timeline-labels span {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0 4px;
}

.timeline-labels span:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.timeline-labels span.active {
    color: var(--accent);
    font-weight: 800;
    text-shadow: 0 0 8px var(--accent-glow);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    #ui-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        grid-template-areas: 
            "header"
            "content"
            "sidebar";
        padding: 12px;
        gap: 12px;
    }
    
    #room-sidebar {
        grid-area: sidebar;
        height: 35vh;
        width: 100%;
        margin-top: auto;
        border-top: 1px solid var(--panel-border);
        border-bottom: none;
        border-left: none;
        border-right: none;
        border-radius: 20px 20px 0 0;
        padding: 20px;
        transform: translateY(0) !important; /* Keep visible at bottom */
        z-index: 15;
    }

    #cost-sidebar {
        grid-area: sidebar;
        height: 35vh;
        width: 100%;
        margin-top: auto;
        border-top: 1px solid var(--panel-border);
        border-bottom: none;
        border-left: none;
        border-right: none;
        border-radius: 20px 20px 0 0;
        padding: 20px;
        transform: translateY(120%);
        transition: transform 0.3s ease;
        z-index: 16;
    }
    
    #cost-sidebar.visible {
        transform: translateY(0) !important;
    }
    
    .main-header {
        flex-direction: row;
        height: auto;
        padding: 12px;
        gap: 8px;
        justify-content: space-between;
    }
    
    .logo-area h1 {
        font-size: 1.0rem;
    }
    
    .logo-area .badge {
        display: none;
    }
    
    .logo-area .area-tag {
        font-size: 0.6rem;
    }
    
    .header-divider {
        display: none;
    }
    
    .view-selector {
        padding: 2px;
    }
    
    .view-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
    
    .mobile-only-btn {
        display: flex !important;
    }
    
    .quick-nav {
        grid-area: content;
        align-self: end;
        margin-bottom: 45vh; /* Push above the bottom sheet/timeline combo */
        width: calc(100% - 24px);
        padding: 8px;
    }
    
    .nav-buttons {
        gap: 6px;
    }
    
    .nav-room-btn {
        padding: 6px 10px;
        font-size: 0.65rem;
    }
    
    #timeline-container {
        grid-area: content;
        align-self: end;
        margin-bottom: 37vh; /* Float just below quick-nav */
        width: calc(100% - 24px);
        padding: 8px 16px;
        gap: 10px;
    }
    
    .timeline-slider-wrapper {
        width: 100%;
    }
    
    .env-controls {
        top: 130px;
        bottom: auto;
        right: 12px;
        flex-direction: row;
        gap: 6px;
    }
    
    #walkthrough-helper {
        top: 190px;
        right: 12px;
        font-size: 0.7rem;
        padding: 6px 10px;
    }
}
