/* Mobile-First Demo Styles */
* {
    box-sizing: border-box !important;
}

body {
    overflow-x: hidden;
    background: #0f172a;
    width: 100%;
    max-width: 100%;
}

#interactive-demo {
    padding: 20px 0;
    background: radial-gradient(circle at 50% top, #1e293b 0%, #020617 100%);
}

/* Fix Logo Size on Mobile */
.logo-img {
    height: 42px !important;
    /* Standardized mobile height to match main site */
    width: auto !important;
    /* Preserve natural aspect ratio */
    max-width: none !important;
    /* Prevent shrinking */
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    object-fit: contain !important;
}

.demo-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    align-items: center;
    /* Force center alignment for all sections */
}

/* --- 1. VISUALIZER (TOP) --- */
.dashboard-right-panel {
    width: 100%;
    margin-bottom: 20px;
    order: -1;
    /* Move to top visually without changing DOM */
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
}

/* Consistent 300px Height for ALL visualizers */
.floor-plan-container {
    width: 100%;
    max-width: 100%;
    height: 300px !important;
    /* Fixed height */
    background-image: url('../images/demo-home.webp');
    background-size: cover;
    background-position: center;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    filter: brightness(0.9);
}

.balcony-viewport,
.door-viewport {
    width: 100%;
    max-width: 100%;
    height: 300px !important;
    /* MATCH HOUSE LAYOUT HEIGHT */
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    border-radius: 0 0 24px 24px;
    overflow: hidden;
    position: relative;
}

/* Hide bubbles */
.status-bubble,
.interaction-hint.door-hint {
    /* Higher specificity to override generic .interaction-hint */
    display: none !important;
}

/* --- 2. NAVIGATION (MIDDLE) --- */
.dashboard-left-panel {
    padding: 0 !important;
    /* Zero padding to allow edge-to-edge panel */
    width: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dashboard-nav {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 10px 15px;
    /* Keep padding for nav items scrolling */
    scrollbar-width: none;
    justify-content: center !important;
    margin-bottom: 5px;
    width: 100%;
}

/* ... existing .dashboard-tab styles ... */

/* --- 3. CONTROLS (BOTTOM) --- */
.dashboard-section {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: none;
    /* Default hidden */
}

.dashboard-section.active {
    display: block !important;
}

.controller-hub {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}

.controller-viewport {
    width: 100% !important;
    display: block !important;
    /* Ensure block flow, not flex centering */
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide Switcher (App/Wall) */
.mode-switcher {
    display: none !important;
}

/* Force Wall Panel Visibility */
.smart-switch-panel {
    position: relative !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    perspective: none !important;
    padding: 10px;
    /* Slight padding so it doesn't touch screen edge perfectly? Or user wants FULL width? User said "till the width of the device". I'll give it 5px padding. */
    box-sizing: border-box !important;
}

.switch-glass {
    width: 100% !important;
    aspect-ratio: auto !important;
    /* Remove fixed aspect ratio constraints if needed */
    height: auto !important;
    /* Let content dictate height */
    min-height: 350px;
    /* Ensure good touch area */
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 20px;
    /* Keep corners slightly rounded or 0 for edge-to-edge? 20px is safe mobile standard */
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    border: 2px solid #d4af37 !important;
    /* Golden Border */
    margin: 0 !important;
}

.switch-module {
    background: rgba(255, 255, 255, 0.05);
    /* Slightly lighter for contrast */
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.1s ease-in-out;
    /* Fast transition for button feel */
    position: relative;
    overflow: hidden;
    /* Contain any ripples */
}

/* Button Press Effect */
.switch-module:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.08);
}

.switch-module i {
    font-size: 2rem;
    color: #64748b;
    transition: 0.2s;
}

/* Active State (ON) - Crisp, not blurry */
.switch-module.active {
    background: rgba(212, 175, 55, 0.15);
    /* Gold tint background */
    border-color: #d4af37;
    box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.2);
    /* Inner glow instead of outer blur */
}

.switch-module.active i {
    color: #fff;
    text-shadow: none !important;
    /* Remove fuzzy text blur */
}

.led-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #334155;
    transition: 0.3s;
}

.switch-module.active .led-indicator {
    background: #d4af37;
    /* Solid Gold */
    box-shadow: 0 0 5px #d4af37;
    /* Small sharp glow */
}

.switch-label {
    margin-top: 15px;
    text-align: center;
    opacity: 0.5;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

/* Ensure Phone Controller is hidden */
.phone-controller {
    display: none !important;
}

/* Interaction Hint - Finger Pointing to Switch */
.interaction-hint {
    display: flex !important;
    position: absolute;
    /* Overlay on top of the panel */
    top: 20%;
    /* Roughly centers on the first/top-left button */
    left: 25%;
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: none;
    /* Don't block the click */
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.interaction-hint i {
    font-size: 2.5rem;
    /* Large finger icon */
    color: rgba(255, 255, 255, 0.9);
    animation: tapGesture 1.5s infinite;
    transform-origin: top left;
}

.interaction-hint span {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-top: 5px;
    white-space: nowrap;
}

/* Tap Animation */
@keyframes tapGesture {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }

    50% {
        transform: scale(0.8) rotate(-10deg);
        opacity: 1;
    }

    /* Press down */
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }
}

/* Specific Hint Positioning */
.physical-remote {
    position: relative !important;
    width: 200px !important;
    /* Fixed width for remote look */
    height: auto !important;
    /* Hug content */
    min-height: 400px;
    margin: 20px auto !important;
    /* Center horizontally */
    border: 2px solid #d4af37 !important;
    /* Golden Border */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    border-radius: 40px !important;
    background: #050a15 !important;
    /* Ensure dark bg */
}

.smart-lock-panel {
    position: relative !important;
    /* Ensure hint is relative to this container */
}

/* Adjust hint position for remote (point to Open button) */
.remote-hint {
    top: 75% !important;
    /* Point to Close button (bottom) */
    left: 70% !important;
}

/* Scale down 3D scenes to fit 300px height */
.door-scene,
.balcony-scene {
    position: absolute;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    /* Reset scale */
    width: 100% !important;
    /* Fill container native width */
    height: 100% !important;
    /* Fill container native height (300px) */
    background-size: cover !important;
}

/* Specific fix for door frame which has specific pixel dimensions in demo.css */
.door-frame {
    /* Originally 200x400px. Scaling scene by 0.65 makes it ~260px tall. Perfect for 300px container. */
}

/* Ensure background covers the gap */
.hall-bg,
.city-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
}

/* Curtain Fixes for Mobile */
.curtain-track {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
}

.curtain {
    width: 50% !important;
    height: 100% !important;
    background: #cbd5e1 !important;
    /* Flat Light Slate */
    background-image: none !important;
    box-shadow: none !important;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    /* Subtle divider */
}

/* Door Fixes for Mobile - Lighten */
.door-leaf {
    background: #deb887 !important;
    /* Burlywood / Light Canvas Wood */
    background-image: none !important;
    box-shadow: none !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

/* --- 4. LIGHTING OVERRIDES (SQUARE FILL) --- */
.room::before,
.room::after {
    border-radius: 8px !important;
    /* Make lights square/rectangular */
}

/* Make the Room Glow fill the entire room area */
.room::after {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    filter: blur(10px) !important;
    /* Less blur to see shape */
    mix-blend-mode: overlay !important;
    /* Better blend for full fill */
}

/* Adjust gradients for a "filled room" look */
.living-room::after {
    background: rgba(255, 200, 80, 0.4) !important;
}

.kitchen::after {
    background: rgba(255, 255, 220, 0.45) !important;
}

.bedroom::after {
    background: rgba(255, 180, 80, 0.4) !important;
}

/* Hide the small "bulb" dot to just show full room fill */
/* --- 5. AI AVATAR MOBILE FIXES --- */
.ai-avatar,
.concierge-launcher {
    /* Force visibility and colors */
    background: linear-gradient(135deg, #d4af37 0%, #f3e5b5 100%) !important;
    color: #0f172a !important;
    /* Dark Navy Text/Icon */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4) !important;
}

.ai-avatar i,
.concierge-launcher i {
    color: #0f172a !important;
    font-size: 1.5rem !important;
    display: block !important;
    z-index: 10 !important;
}

/* Ensure the pulse doesn't cover the icon */
.ai-status-pulse {
    z-index: 1 !important;
}

/* Ensure the launcher is well above everything */
.concierge-launcher {
    z-index: 9999 !important;
}