/* -------------------------------------------------------------
   Uma Maheswara Constructions — Royal Crest Residency (1030 SFT)
   3D Floorplan Virtual Walkthrough Stylesheet
   Theme: Luxury Champagne Gold, Deep Sapphire Onyx & Glassmorphism
------------------------------------------------------------- */

:root {
    --bg-primary: #07090d;
    --bg-secondary: #0d1117;
    --panel-bg: rgba(13, 17, 24, 0.82);
    --panel-bg-hover: rgba(18, 24, 34, 0.92);
    --panel-border: rgba(223, 183, 116, 0.2);
    --panel-border-bright: rgba(223, 183, 116, 0.5);
    --accent: #dfb774; /* Luxury Champagne Gold */
    --accent-light: #f7d59b;
    --accent-glow: rgba(223, 183, 116, 0.4);
    --accent-gradient: linear-gradient(135deg, #dfb774 0%, #f7d59b 50%, #b88d44 100%);
    --rera-green: #2ecc71;
    --vmrda-blue: #3498db;
    --text-main: #f3f5f8;
    --text-muted: #9aa4b2;
    --text-gold: #e5c388;
    --shadow-premium: 0 16px 40px rgba(0, 0, 0, 0.65);
    --shadow-glow: 0 0 25px rgba(223, 183, 116, 0.25);
    --font-stack: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Cinzel', serif;
}

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

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

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

/* UI Overlay Container Grid */
#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Passes clicks through to Three.js canvas */
    display: grid;
    grid-template-columns: 340px 1fr 340px;
    grid-template-rows: 86px 1fr 58px 74px;
    grid-template-areas: 
        "header header header"
        "sidebar content specs"
        "sidebar timeline specs"
        "sidebar footer specs";
    padding: 20px 24px;
    gap: 16px;
}

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

.glass-panel:hover {
    border-color: var(--panel-border-bright);
}

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

.brand-container {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(223, 183, 116, 0.4));
}

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

.badge-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--accent);
    background: rgba(223, 183, 116, 0.12);
    border: 1px solid var(--accent);
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-rera {
    color: #4cd137;
    background: rgba(76, 209, 55, 0.12);
    border-color: rgba(76, 209, 55, 0.6);
}

.badge-vmrda {
    color: #48dbfb;
    background: rgba(72, 219, 251, 0.12);
    border-color: rgba(72, 219, 251, 0.6);
}

.logo-area h1 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-light) 60%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.area-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.header-divider {
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(223, 183, 116, 0.2), transparent);
    margin: 0 28px;
}

/* Unit Selector Tabs (Toggle between 2655 SFT & 1030 SFT) */
.unit-selector {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.55);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(223, 183, 116, 0.35);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.unit-pill {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: 8px;
    font-family: var(--font-stack);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
}

.unit-pill:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.unit-pill.active {
    background: var(--accent-gradient);
    color: #0c0e12;
    font-weight: 800;
    box-shadow: 0 4px 18px rgba(223, 183, 116, 0.45);
    transform: translateY(-1px);
}

.unit-pill-badge {
    font-size: 0.68rem;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.15);
    font-weight: 800;
}

.unit-pill.active .unit-pill-badge {
    background: rgba(0, 0, 0, 0.25);
    color: #1a1505;
}

/* View Selector Tabs */
.view-selector {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.view-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}

.view-btn.active {
    background: var(--accent-gradient);
    color: #0c0e12;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(223, 183, 116, 0.35);
}

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

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

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(223, 183, 116, 0.15);
}

.section-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent);
    display: block;
    margin-bottom: 2px;
}

.section-label {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-main);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1.3rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    color: #ff6b6b;
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

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

.room-title-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.room-title-card h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.room-badge {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(223, 183, 116, 0.12);
    border: 1px solid var(--accent);
    padding: 2px 8px;
    border-radius: 20px;
}

.dimensions-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(223, 183, 116, 0.12);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

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

.dimension-row:last-child {
    margin-bottom: 0;
}

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

.dim-value {
    font-weight: 700;
    color: var(--accent);
}

#room-desc {
    font-size: 0.86rem;
    color: var(--text-main);
    line-height: 1.55;
    margin-bottom: 16px;
}

.feature-section h4 {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-light);
    margin-bottom: 8px;
    text-transform: uppercase;
}

#room-features {
    list-style: none;
    margin-bottom: 18px;
}

#room-features li {
    font-size: 0.82rem;
    color: var(--text-muted);
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
    line-height: 1.35;
}

#room-features li::before {
    content: "▪";
    color: var(--accent);
    position: absolute;
    left: 2px;
    top: -1px;
}

.quick-room-action {
    margin-top: auto;
    margin-bottom: 14px;
}

.action-btn {
    width: 100%;
    background: rgba(223, 183, 116, 0.12);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 9px 12px;
    border-radius: 8px;
    font-family: var(--font-stack);
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--accent);
    color: #0c0e12;
    box-shadow: 0 4px 15px rgba(223, 183, 116, 0.3);
}

.navigation-hints {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
}

.hint-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

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

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

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

/* --- Right Sidebar: Project Specifications Showcase --- */
#specs-sidebar {
    grid-area: specs;
    display: flex;
    flex-direction: column;
    padding: 22px;
    height: 100%;
    overflow-y: auto;
}

.specs-scroll-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.developer-card {
    background: linear-gradient(135deg, rgba(223, 183, 116, 0.08) 0%, rgba(0, 0, 0, 0.3) 100%);
    border: 1px solid rgba(223, 183, 116, 0.2);
    border-radius: 12px;
    padding: 14px;
}

.dev-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.dev-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.dev-header h4 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.dev-tagline {
    font-size: 0.65rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 1px;
}

.dev-quote {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.4;
}

.approvals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.approval-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.approval-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.approval-badge-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
}

.approval-info {
    display: flex;
    flex-direction: column;
}

.app-title {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.app-num {
    font-size: 0.72rem;
    font-weight: 800;
    color: #ffffff;
}

.spec-category {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
}

.category-header {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-light);
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.amenities-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.amenity-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.amenity-icon {
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
}

.amenity-text {
    display: flex;
    flex-direction: column;
}

.amenity-text strong {
    font-size: 0.78rem;
    color: var(--text-main);
}

.amenity-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.materials-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.material-pill {
    background: rgba(223, 183, 116, 0.06);
    border: 1px solid rgba(223, 183, 116, 0.15);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
    width: 100%;
}

.material-pill strong {
    color: var(--accent);
}

.elevation-preview-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(223, 183, 116, 0.3);
    cursor: pointer;
    height: 110px;
    transition: all 0.3s ease;
}

.elevation-preview-card:hover {
    border-color: var(--accent);
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.elevation-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.elevation-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.2) 100%);
    display: flex;
    align-items: flex-end;
    padding: 10px;
}

.elevation-overlay span {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
}

/* --- 4D Construction Timeline --- */
#timeline-container {
    grid-area: timeline;
    align-self: center;
    display: flex;
    flex-direction: column;
    padding: 10px 20px;
    width: fit-content;
    margin: 0 auto;
    gap: 6px;
    border-radius: 12px;
    background: rgba(10, 13, 18, 0.92);
    border: 1.5px solid var(--accent);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.timeline-tag {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--accent);
}

.timeline-phase-indicator {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    background: rgba(223, 183, 116, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
}

.timeline-slider-wrapper {
    display: flex;
    flex-direction: column;
    width: 340px;
    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: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px 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.75rem;
    color: #ffffff;
    font-weight: 600;
}

.timeline-labels span {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 4px;
}

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

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

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

.nav-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent);
    white-space: nowrap;
}

.nav-buttons {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    max-width: 600px;
}

.nav-room-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 7px 13px;
    border-radius: 8px;
    font-family: var(--font-stack);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.nav-room-btn.active {
    background: var(--accent-gradient);
    color: #0c0e12;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(223, 183, 116, 0.3);
}

/* --- Floating Environment Controls --- */
.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.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

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

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

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

.control-toggle.active {
    background: var(--accent);
    color: #0c0e12;
    box-shadow: 0 0 12px var(--accent-glow);
}

/* --- Walkthrough HUD & Mobile D-Pad --- */
#walkthrough-helper {
    position: absolute;
    top: 104px;
    right: 24px;
    background: rgba(13, 17, 24, 0.92);
    backdrop-filter: blur(16px);
    border: 1.5px solid var(--accent);
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.82rem;
    pointer-events: auto;
    animation: fadeIn 0.4s ease forwards;
    z-index: 20;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.helper-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.walk-badge {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--accent);
}

.exit-walk-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: all 0.2s ease;
}

.exit-walk-btn:hover {
    background: #e74c3c;
    border-color: #e74c3c;
}

/* On-Screen Mobile D-Pad */
.mobile-walk-dpad {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.dpad-mid {
    display: flex;
    gap: 4px;
}

.dpad-btn {
    width: 44px;
    height: 44px;
    background: rgba(223, 183, 116, 0.18);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.dpad-btn:active {
    background: var(--accent);
    color: #0c0e12;
}

/* --- Modals Styling --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 9, 0.88);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
    animation: fadeIn 0.3s ease;
    pointer-events: auto;
}

.modal-content {
    max-width: 960px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 22px;
    border-radius: 16px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(223, 183, 116, 0.2);
    gap: 12px;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
}

.modal-header p {
    font-size: 0.72rem;
    color: var(--accent);
}

.modal-tab-switch {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-pill {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-pill.active {
    background: var(--accent);
    color: #0c0e12;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.modal-close-btn:hover, .modal-close-btn:active {
    background: #ff5252;
    border-color: #ff5252;
    color: #ffffff;
    transform: scale(1.08);
}

.modal-footer {
    display: flex;
    justify-content: center;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid rgba(223, 183, 116, 0.2);
    width: 100%;
}

.modal-exit-btn {
    background: linear-gradient(135deg, rgba(223, 183, 116, 0.22) 0%, rgba(223, 183, 116, 0.1) 100%);
    border: 1.5px solid var(--accent);
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 10px;
    font-family: var(--font-stack);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.modal-exit-btn:hover, .modal-exit-btn:active {
    background: var(--accent);
    color: #0c0e12;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(223, 183, 116, 0.4);
}

.modal-body {
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 8px;
}

.building-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.building-details-pane h4 {
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.building-details-pane ul {
    list-style: none;
}

.building-details-pane li {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 14px;
    position: relative;
}

.building-details-pane li::before {
    content: "•";
    color: var(--accent);
    position: absolute;
    left: 0;
}

.hidden {
    display: none !important;
}

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

/* Custom Scrollbars */
#room-sidebar::-webkit-scrollbar,
#specs-sidebar::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.nav-buttons::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

#room-sidebar::-webkit-scrollbar-thumb,
#specs-sidebar::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.nav-buttons::-webkit-scrollbar-thumb {
    background: rgba(223, 183, 116, 0.25);
    border-radius: 10px;
}

/* Drawer Handle for Mobile Swipeable Bottom Sheets */
.drawer-handle {
    display: none;
    width: 42px;
    height: 4.5px;
    background: rgba(223, 183, 116, 0.4);
    border-radius: 4px;
    margin: 2px auto 12px auto;
    cursor: pointer;
    transition: background 0.2s ease;
}

.drawer-handle:hover, .drawer-handle:active {
    background: var(--accent);
}

/* ==========================================================================
   TABLET & MOBILE RESPONSIVE DESIGN SYSTEM (PORTRAIT & LANDSCAPE OPTIMIZED)
   ========================================================================== */

@media (max-width: 1024px) {
    #ui-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        grid-template-areas: 
            "header"
            "content"
            "footer";
        padding: 8px;
        gap: 6px;
    }

    .main-header {
        padding: 8px 12px;
        border-radius: 12px;
    }

    .brand-logo {
        width: 34px;
        height: 34px;
    }

    .logo-area h1 {
        font-size: 0.9rem;
        letter-spacing: 0.5px;
    }

    .area-tag {
        font-size: 0.58rem;
    }

    .badge-row .badge {
        font-size: 0.52rem;
        padding: 1px 4px;
    }

    .view-btn {
        padding: 6px 10px;
        font-size: 0.72rem;
    }

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

    .header-divider {
        display: none;
    }

    #timeline-container {
        display: none;
    }

    .drawer-handle {
        display: block;
    }
}

/* --------------------------------------------------------------------------
   1. MOBILE PORTRAIT VIEW (TALL SCREENS: iPhones, Androids, Foldables)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) and (orientation: portrait), (max-width: 600px) {
    #ui-container {
        padding: 6px;
    }

    .main-header {
        padding: 6px 10px;
        border-radius: 12px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .brand-container {
        gap: 8px;
    }

    .brand-logo {
        width: 28px;
        height: 28px;
    }

    .logo-area h1 {
        font-size: 0.82rem;
        letter-spacing: 0.3px;
        line-height: 1.1;
    }

    .area-tag {
        display: none; /* Keep header ultra-clean */
    }

    .badge-row .badge-rera, 
    .badge-row .badge-vmrda {
        display: none; /* Hide legal codes in top bar on mobile to save vertical space */
    }

    .badge-row .badge {
        font-size: 0.5rem;
        padding: 1px 5px;
    }

    .view-selector {
        width: 100%;
        display: flex;
        justify-content: space-between;
        gap: 4px;
        margin-top: 2px;
    }

    .view-btn {
        flex: 1;
        justify-content: center;
        padding: 6px 4px;
        font-size: 0.68rem;
        gap: 3px;
        border-radius: 6px;
    }

    .view-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Swipeable Bottom Sheet Drawer for Room Inspector */
    #room-sidebar {
        position: fixed;
        left: 0;
        bottom: 0;
        right: 0;
        width: 100%;
        max-height: 52vh;
        height: auto;
        z-index: 55;
        transform: translateY(120%);
        transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
        border-radius: 20px 20px 0 0;
        padding: 6px 16px 20px 16px;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.9);
        border: 1.5px solid rgba(223, 183, 116, 0.3);
        border-bottom: none;
        pointer-events: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #room-sidebar.visible {
        transform: translateY(0) !important;
    }

    /* Swipeable Specs Bottom Sheet */
    #specs-sidebar {
        position: fixed;
        left: 0;
        bottom: 0;
        right: 0;
        width: 100%;
        max-height: 68vh;
        height: auto;
        z-index: 65;
        transform: translateY(120%);
        transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
        border-radius: 22px 22px 0 0;
        padding: 6px 16px 24px 16px;
        box-shadow: 0 -12px 45px rgba(0, 0, 0, 0.95);
        border: 1.5px solid rgba(223, 183, 116, 0.35);
        border-bottom: none;
        pointer-events: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #specs-sidebar.visible {
        transform: translateY(0) !important;
    }

    /* Quick Tour Bar: Floating at bottom with horizontal momentum scroll */
    .quick-nav {
        position: absolute;
        bottom: 8px;
        left: 8px;
        right: 8px;
        width: auto;
        padding: 6px 10px;
        margin: 0;
        z-index: 20;
        background: rgba(8, 11, 16, 0.9);
        backdrop-filter: blur(14px);
        border: 1px solid rgba(223, 183, 116, 0.3);
        border-radius: 12px;
        gap: 6px;
    }

    .nav-label {
        font-size: 0.65rem;
    }

    .nav-buttons {
        gap: 5px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-buttons::-webkit-scrollbar {
        display: none;
    }

    .nav-room-btn {
        padding: 6px 10px;
        font-size: 0.72rem;
        border-radius: 6px;
    }

    /* Floating Toolbar: Compact vertical dock on right side above Quick Tour */
    .env-controls {
        position: absolute;
        bottom: 60px;
        right: 8px;
        z-index: 22;
        gap: 5px;
        padding: 4px;
        background: rgba(8, 11, 16, 0.8);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(223, 183, 116, 0.2);
        border-radius: 10px;
    }

    .control-toggle {
        width: 34px;
        height: 34px;
        border-radius: 7px;
    }

    .control-toggle svg {
        width: 17px;
        height: 17px;
    }

    /* Walkthrough HUD on Mobile Portrait */
    #walkthrough-helper {
        position: absolute;
        bottom: 62px;
        left: 8px;
        top: auto;
        right: auto;
        padding: 10px 14px;
        border-radius: 14px;
        z-index: 30;
    }

    .mobile-walk-dpad {
        display: flex;
    }

    .dpad-btn {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    /* Mobile Modals Optimization */
    .modal-overlay {
        padding: 8px;
    }

    .modal-content {
        padding: 12px;
        max-height: 95vh;
        border-radius: 14px;
        position: relative;
    }

    .modal-header {
        flex-wrap: wrap;
        gap: 8px;
        position: relative;
        padding-right: 46px;
    }

    .modal-header .modal-close-btn {
        position: absolute;
        top: 0;
        right: 0;
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid var(--accent);
    }

    .modal-title-box h3 {
        font-size: 0.85rem;
    }

    .modal-title-box p {
        font-size: 0.65rem;
    }

    .modal-tab-switch {
        width: 100%;
        justify-content: center;
    }

    .modal-tab-switch .tab-pill {
        flex: 1;
        text-align: center;
        padding: 6px 8px;
        font-size: 0.72rem;
    }

    .modal-image {
        max-height: 52vh;
    }

    .building-modal-body {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* --------------------------------------------------------------------------
   2. MOBILE LANDSCAPE VIEW (WIDE SCREEN / ROTATED PHONES)
   -------------------------------------------------------------------------- */
@media (max-height: 520px) and (orientation: landscape) {
    #ui-container {
        padding: 4px 8px;
        grid-template-rows: auto 1fr auto;
    }

    .main-header {
        height: 36px;
        padding: 3px 10px;
        border-radius: 8px;
    }

    .brand-logo {
        width: 24px;
        height: 24px;
    }

    .logo-area h1 {
        font-size: 0.78rem;
    }

    .badge-row, .area-tag {
        display: none; /* Maximum 3D canvas visibility */
    }

    .view-btn {
        padding: 4px 8px;
        font-size: 0.68rem;
    }

    .view-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Side Docking for Room Inspector in Landscape */
    #room-sidebar {
        position: fixed;
        top: 44px;
        left: 8px;
        bottom: 8px;
        width: 270px;
        height: auto;
        max-height: none;
        z-index: 50;
        transform: translateX(-120%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        border-radius: 12px;
        padding: 10px 12px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85);
        border: 1px solid rgba(223, 183, 116, 0.3);
        pointer-events: auto;
        overflow-y: auto;
    }

    #room-sidebar.visible {
        transform: translateX(0) !important;
    }

    /* Side Docking for Specs in Landscape */
    #specs-sidebar {
        position: fixed;
        top: 44px;
        right: 8px;
        bottom: 8px;
        width: 300px;
        height: auto;
        max-height: none;
        z-index: 60;
        transform: translateX(120%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        border-radius: 12px;
        padding: 10px 12px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85);
        border: 1px solid rgba(223, 183, 116, 0.3);
        pointer-events: auto;
        overflow-y: auto;
    }

    #specs-sidebar.visible {
        transform: translateX(0) !important;
    }

    /* Centered Compact Quick Tour Bar */
    .quick-nav {
        position: absolute;
        bottom: 6px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        max-width: 60vw;
        padding: 4px 8px;
        border-radius: 8px;
        z-index: 20;
    }

    .nav-label {
        display: none;
    }

    .nav-room-btn {
        padding: 4px 8px;
        font-size: 0.68rem;
    }

    /* Floating Toolbar in Landscape */
    .env-controls {
        position: absolute;
        bottom: 6px;
        right: 8px;
        z-index: 22;
        gap: 4px;
        padding: 3px;
        border-radius: 8px;
    }

    .control-toggle {
        width: 30px;
        height: 30px;
    }

    .control-toggle svg {
        width: 15px;
        height: 15px;
    }

    /* Walkthrough in Landscape */
    #walkthrough-helper {
        position: absolute;
        bottom: 6px;
        left: 8px;
        top: auto;
        right: auto;
        padding: 6px 10px;
        border-radius: 10px;
        z-index: 30;
    }

    .mobile-walk-dpad {
        display: flex;
    }

    .dpad-btn {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }
}
