/* ECO HOME Platform CSS - Premium Glassmorphism & Sureserve Branding */

:root {
    --brand-purple: #9b6eff; /* Brighter purple for maximum contrast */
    --brand-purple-glow: rgba(155, 110, 255, 0.5);
    --brand-purple-dark: #7c3aed;
    
    --bg-dark: #05020c;
    --text-light: #ffffff;    /* Absolute white for max contrast */
    --text-gray: #f3f4f6;     /* Brightest gray (level 100) for body text */
    --text-muted: #cbd5e1;    /* Extremely high-contrast slate-300 for captions */
    
    --glass-bg: rgba(10, 5, 20, 0.92); /* Higher opacity for absolute text legibility on panoramas */
    --glass-border: rgba(255, 255, 255, 0.28); /* Highly visible border */
    --glass-border-hover: rgba(155, 110, 255, 0.65);
    --glass-glow: 0 12px 40px 0 rgba(0, 0, 0, 0.75), 0 0 20px rgba(155, 110, 255, 0.15);
    
    /* Category Accent Colors - Increased saturation for high contrast accessibility */
    --color-survey: #c084fc;
    --color-insulation: #34d399;
    --color-heating: #fb923c;
    --color-electrical: #fbbf24;
    --color-ventilation: #60a5fa;
    
    --font-outfit: 'Outfit', sans-serif;
}

/* Core reset & defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font-outfit);
    color: var(--text-light);
    -webkit-font-smoothing: antialiased;
}

/* General Layout elements */
#app-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    pointer-events: none; /* Let all mouse/drag events pass to KRPANO underneath */
    touch-action: none;   /* Avoid blocking multi-touch gestures on mobile */
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

#app-container.ui-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Enable pointer events selectively on UI panels */
.glassmorphic, .glassmorphic-header, .close-circle-btn, .glow-button, .ios-switch, .category-item {
    pointer-events: auto; /* Re-enable clicks for actual HUD items */
    touch-action: auto;   /* Keep scroll/touch interaction active on specific panels */
}

/* Fullscreen KRPANO Stage */
#pano-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: #000;
    pointer-events: auto !important; /* Capture dragging events directly on KRPANO */
    touch-action: auto !important;   /* Let KRPANO process all rotational touch events */
    transform: scale(1.0);
    filter: blur(0px);
    transition: filter 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Beautiful blur + scale up slightly to hide browser edge-blur artifacts */
#pano-container.welcome-blur {
    filter: blur(20px) saturate(140%);
    transform: scale(1.05);
}

#pano {
    width: 100%;
    height: 100%;
    pointer-events: auto !important;
    touch-action: auto !important;
}

/* Translucent Glassmorphism Base Styles */
.glassmorphic {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-glow);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glassmorphic:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* MODAL OVERLAY (WELCOME BOX) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(5, 2, 12, 0.4); /* Soft translucent screen */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
}

.modal-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
}

.modal-overlay.fade-out * {
    pointer-events: none !important;
}

.welcome-card {
    max-width: 520px;
    width: 90%;
    padding: 48px;
    text-align: center;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(18, 9, 36, 0.6);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(124, 58, 237, 0.15);
    transform: translateY(0);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.fade-out .welcome-card {
    transform: translateY(-20px);
}

.welcome-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 100px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: var(--color-survey);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.welcome-logo-wrapper {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    color: #fff;
}

.welcome-logo-wrapper svg {
    height: 100%;
    width: auto;
    color: #fff;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

.welcome-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 30%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-text {
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--text-gray);
    margin-bottom: 36px;
}

/* GLOW BUTTON STYLE */
.glow-button {
    width: 100%;
    padding: 16px 32px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--brand-purple) 0%, #6d28d9 100%);
    color: #fff;
    font-family: var(--font-outfit);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px var(--brand-purple-glow);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.glow-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.glow-button:hover::before {
    left: 100%;
}

.glow-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.6);
    background: linear-gradient(135deg, #8b5cf6 0%, var(--brand-purple) 100%);
}

.glow-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px var(--brand-purple-glow);
}

.btn-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.glow-button:hover .btn-arrow {
    transform: translateX(4px);
}

/* TOP HUD HEADER */
/* Hamburger Menu Button (Hidden by default) */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.glassmorphic-header {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    height: 76px;
    padding: 0 28px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    
    background: rgba(14, 6, 30, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: var(--glass-glow);
}

/* Base fade-in animation for dynamic layers */
@keyframes fadeInUI {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-ui-enter {
    animation: fadeInUI 0.8s ease-out forwards;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo-wrapper {
    height: 28px;
    display: flex;
    align-items: center;
    color: var(--text-light);
}

.logo-wrapper svg {
    height: 100%;
    width: auto;
    color: #fff;
    transition: color 0.3s ease;
}

.logo-wrapper:hover svg {
    color: var(--color-survey);
}

.logo-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
}

.app-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-gray);
    text-transform: uppercase;
}

.hud-stats {
    display: flex;
    gap: 24px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.text-purple {
    color: var(--color-survey);
}

.text-green {
    color: var(--color-insulation);
}

/* INTEGRATED HEADER DISRUPTION TOGGLE */
.header-toggle-panel {
    display: flex;
    align-items: center;
    gap: 20px;
    pointer-events: auto;
}

.toggle-header-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-toggle-panel .toggle-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-gray);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-heating);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-heating);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}
.animate-pulse {
    animation: pulse 2s infinite ease-in-out;
}

.header-toggle-panel .toggle-control-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 6px 14px;
}

.toggle-state-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.toggle-state-label.active {
    color: var(--text-light);
}

#toggle-state-off.active {
    color: #fca5a5;
    text-shadow: 0 0 10px rgba(252, 165, 165, 0.4);
}

#toggle-state-on.active {
    color: var(--color-heating);
    text-shadow: 0 0 10px rgba(251, 146, 60, 0.4);
}

/* iOS/Android Custom Toggle Switch */
.ios-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: .4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 34px;
}

.slider-round:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: .4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
}

input:checked + .slider-round {
    background-color: var(--brand-purple);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

input:checked + .slider-round:before {
    transform: translateX(24px);
}

/* LEFT NAVIGATION MENU (CATEGORIES) */
.menu-panel {
    position: absolute;
    left: 24px;
    top: 120px;
    width: 300px;
    padding: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    height: auto; /* Conform strictly to content height */
    max-height: calc(100vh - 300px); /* Ensure it leaves room for circular video at bottom */
    background: rgba(10, 5, 20, 0.75); /* High-contrast frosted glass */
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 20px;
    box-shadow: var(--glass-glow);
}

.menu-header {
    margin-bottom: 20px;
}

.menu-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.menu-header p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 4px;
}

/* Custom Scrollbar for side list */
.category-list::-webkit-scrollbar {
    width: 4px;
}
.category-list::-webkit-scrollbar-track {
    background: transparent;
}
.category-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.category-item.active {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.15);
}

.category-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.category-icon svg {
    width: 18px;
    height: 18px;
}

/* Category Specific Active State Coloring */
.category-item.active .category-icon {
    color: #fff;
}

.category-item[data-category="survey"].active .category-icon { background: var(--color-survey); }
.category-item[data-category="insulation"].active .category-icon { background: var(--color-insulation); }
.category-item[data-category="heating"].active .category-icon { background: var(--color-heating); }
.category-item[data-category="electrical"].active .category-icon { background: var(--color-electrical); }
.category-item[data-category="ventilation"].active .category-icon { background: var(--color-ventilation); }

/* Non-active left side icons colored dot accents on hover */
.category-item:hover .icon-survey { color: var(--color-survey); }
.category-item:hover .icon-insulation { color: var(--color-insulation); }
.category-item:hover .icon-heating { color: var(--color-heating); }
.category-item:hover .icon-electrical { color: var(--color-electrical); }
.category-item:hover .icon-ventilation { color: var(--color-ventilation); }

.category-label {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-gray);
    transition: color 0.3s ease;
}

.category-item.active .category-label {
    color: #fff;
    font-weight: 600;
}

/* RIGHT SIDEBAR PANEL: HOTSPOT DETAILS */
.info-sidebar {
    position: absolute;
    right: 24px;
    top: 120px;
    bottom: 24px;
    width: 380px;
    padding: 32px 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.info-sidebar.hidden {
    transform: translateX(50px);
    opacity: 0;
    pointer-events: none;
}

.sidebar-scrollable-content {
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-right: 2px;
}

.sidebar-scrollable-content::-webkit-scrollbar {
    width: 4px;
}
.sidebar-scrollable-content::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-scrollable-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Circle Close Button */
.close-circle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.close-circle-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    transform: rotate(90deg);
}

.category-badge-container {
    margin-bottom: 14px;
    margin-top: 10px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Badge category colors */
.badge-survey {
    background: rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.35);
    color: var(--color-survey);
}
.badge-insulation {
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.35);
    color: var(--color-insulation);
}
.badge-heating {
    background: rgba(251, 146, 92, 0.12);
    border-color: rgba(251, 146, 92, 0.35);
    color: var(--color-heating);
}
.badge-electrical {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.35);
    color: var(--color-electrical);
}
.badge-ventilation {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.35);
    color: var(--color-ventilation);
}

.upgrade-title {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #ffffff 40%, #ddd6fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.upgrade-description {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-gray);
    margin-bottom: 24px;
    font-weight: 300;
}

.upgrade-description p {
    margin-bottom: 12px;
}

/* Stats grid cards */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 12px 14px;
    border-radius: 12px;
}

.stat-card-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-card-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-light);
}

/* Disruption pill status card */
.disruption-status-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--brand-purple);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 28px;
}

.status-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.disruption-pill {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
}

.pill-low {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.pill-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}
.pill-high {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.status-card-desc {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-gray);
    font-weight: 300;
}

.upgrade-action-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-family: var(--font-outfit);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    margin-top: auto;
    transition: all 0.3s ease;
}

.glow-purple {
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: #c4b5fd;
}

.glow-purple:hover {
    background: var(--brand-purple);
    color: #fff;
    box-shadow: 0 0 15px var(--brand-purple-glow);
    transform: translateY(-1px);
}

/* RESPONSIVE LAYOUT SCALING (Optimized for Mobile/Tablet UX) */
@media (max-width: 900px) {
    .glassmorphic-header {
        top: 10px;
        left: 10px;
        right: 10px;
        height: 56px;
        padding: 0 16px;
        border-radius: 12px;
    }
    
    .logo-divider, .app-subtitle, .hud-stats {
        display: none;
    }
    
    .logo-wrapper {
        height: 22px;
    }
    
    /* Integrated Mobile Toggle styling */
    .header-toggle-panel .toggle-header-compact {
        display: none; /* Hide title & pulse dot on mobile to save horizontal space */
    }
    
    .header-toggle-panel .toggle-control-row {
        padding: 4px 10px;
        border-radius: 8px;
        gap: 8px;
    }
    
    .toggle-state-label {
        font-size: 0.75rem;
    }
    
    .hamburger-btn {
        display: flex;
    }

    .menu-panel {
        left: 10px;
        top: 86px;
        width: calc(100% - 20px);
        bottom: auto;
        height: auto;
        padding: 16px;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        
        /* Dropdown Animation state */
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    }
    
    .menu-panel.mobile-open {
        transform: translateY(0) scale(1);
        opacity: 1;
        pointer-events: auto;
    }
    
    .category-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .category-item {
        width: 100%;
        margin-right: 0;
        border-radius: 12px;
    }

    .category-label {
        display: block;
        font-size: 0.9rem;
    }
    
    .menu-header {
        display: block;
        text-align: center;
        margin-bottom: 12px;
    }

    .category-icon {
        width: 24px;
        height: 24px;
        border-radius: 6px;
    }
    
    .category-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .category-label {
        font-size: 0.78rem;
    }
    
    .category-item:hover {
        transform: none;
    }
    
    /* Info Panel styled as a Premium slide-up Bottom Sheet */
    .info-sidebar {
        right: 10px;
        left: 10px;
        top: auto; /* Override desktop top: 120px */
        bottom: 10px;
        width: calc(100% - 20px);
        height: 330px; /* Fixed height so it leaves plenty of room in the center for 360-rotation */
        padding: 20px;
        border-radius: 16px;
        z-index: 1010;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5), var(--glass-glow);
    }
    
    .info-sidebar.hidden {
        transform: translateY(360px); /* Slide completely down and out of view when closed */
        opacity: 0;
        pointer-events: none;
    }
    
    .welcome-card {
        padding: 24px;
        border-radius: 20px;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .welcome-text {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }
    
    .glow-button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    /* Responsive styles for video card and callout on mobile */
    .video-card {
        padding: 20px;
        gap: 14px;
        border-radius: 16px;
    }
    .video-title {
        font-size: 1.2rem;
    }
    .video-subtitle {
        font-size: 0.8rem;
    }
    .play-callout {
        padding: 8px 14px;
        gap: 8px;
    }
    .callout-label {
        font-size: 0.8rem;
    }
    .callout-play-icon {
        width: 24px;
        height: 24px;
    }
    .callout-play-icon svg {
        width: 12px;
        height: 12px;
    }
}

/* --- PLAY BRIEFING CALLOUT STYLE --- */
.play-callout {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 14px;
    background: rgba(18, 9, 36, 0.85); /* Premium glass violet */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(155, 110, 255, 0.4);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(155, 110, 255, 0.2);
    cursor: pointer;
    pointer-events: auto !important;
    z-index: 999;
    user-select: none;
    transform: translate(-50%, -115%);
    transform-origin: bottom center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.play-callout:hover {
    border-color: rgba(155, 110, 255, 0.8);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(155, 110, 255, 0.4);
    transform: translate(-50%, -115%) scale(1.05);
}

.play-callout:active {
    transform: translate(-50%, -115%) scale(0.98);
}

.callout-play-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-purple) 0%, #6d28d9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 10px var(--brand-purple-glow);
    flex-shrink: 0;
}

.callout-play-icon svg {
    width: 14px;
    height: 14px;
    margin-left: 2px;
}

.callout-label {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
}

/* --- EWI NAVIGATION CALLOUT OVERRIDES --- */

.play-callout.ewi-callout .callout-play-icon svg {
    margin-left: 0; /* Reset since it's not a play triangle */
}

/* --- COMPLETION TICK STYLE --- */
.completion-tick {
    margin-left: auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    border: 1.5px solid #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34d399;
    flex-shrink: 0;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.completion-tick svg {
    width: 11px;
    height: 11px;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- VIDEO BRIEFING MODAL STYLE --- */
.video-card {
    max-width: 800px;
    width: 90%;
    padding: 32px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 5, 22, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(155, 110, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modalSlideUp {
    0% { transform: translateY(40px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.video-modal-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.video-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(155, 110, 255, 0.15);
    border: 1px solid rgba(155, 110, 255, 0.3);
    color: var(--color-survey);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.video-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #ffffff 40%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.video-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 300;
}

.video-player-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.video-player-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    outline: none;
}

.video-modal-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.video-status-text {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-warning-glow {
    color: #fca5a5;
    text-shadow: 0 0 10px rgba(252, 165, 165, 0.4);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-warning-glow::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: pulse 1.5s infinite;
}
/* --- PRODUCT SPECIFICATION MODAL --- */
.product-modal-card {
    max-width: 480px;
    width: 90%;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 5, 22, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(155, 110, 255, 0.15);
    position: relative;
    padding: 12px;
    animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hidden {
    display: none !important;
}

/* --- EWI SPECIFICATIONS DRAWER --- */
.specs-drawer {
    position: absolute;
    right: 24px;
    bottom: 24px;
    width: 380px;
    z-index: 1000;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(0);
    opacity: 1;
}

.specs-drawer.hidden {
    transform: translateY(50px);
    opacity: 0;
    pointer-events: none !important;
}

.specs-drawer-card {
    pointer-events: auto;
    padding: 24px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.specs-drawer-card.glassmorphic {
    background: rgba(10, 5, 20, 0.75);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.drawer-drag-handle {
    display: none;
}

#detail-content-wrapper,
#product-modal-content,
#storage-heater-specs-content,
#ventilation-specs-content,
#ewi-specs-content,
#roofline-specs-content,
#iwi-specs-content,
#heating-specs-content,
#cylinder-specs-content {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 4px;
}

#ewi-specs-content::-webkit-scrollbar,
#roofline-specs-content::-webkit-scrollbar,
#iwi-specs-content::-webkit-scrollbar,
#heating-specs-content::-webkit-scrollbar,
#cylinder-specs-content::-webkit-scrollbar {
    width: 4px;
}
#ewi-specs-content::-webkit-scrollbar-track,
#roofline-specs-content::-webkit-scrollbar-track,
#iwi-specs-content::-webkit-scrollbar-track,
#heating-specs-content::-webkit-scrollbar-track,
#cylinder-specs-content::-webkit-scrollbar-track {
    background: transparent;
}
#ewi-specs-content::-webkit-scrollbar-thumb,
#roofline-specs-content::-webkit-scrollbar-thumb,
#iwi-specs-content::-webkit-scrollbar-thumb,
#heating-specs-content::-webkit-scrollbar-thumb,
#cylinder-specs-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Callouts Overlay Layers */
#callouts-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#callouts-html-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 11;
}

/* Callout Elements */
.tech-dot {
    fill: white;
    filter: drop-shadow(0 0 6px white);
    transition: transform 0.3s ease;
}

.tech-pulse {
    fill: none;
    stroke: white;
    stroke-width: 2.0;
    animation: techPulseAnim 2s infinite ease-out;
    transform-origin: center;
}

@keyframes techPulseAnim {
    0% {
        r: 12px;
        opacity: 0.8;
    }
    100% {
        r: 48px;
        opacity: 0;
    }
}

.tech-line {
    fill: none;
    stroke: white;
    stroke-width: 1.5;
    stroke-dasharray: 4, 3;
}

.tech-callout-chip-wrapper {
    position: absolute;
    pointer-events: none;
}

.tech-callout-chip {
    background: rgba(18, 9, 36, 0.85);
    border: 1px solid rgba(155, 110, 255, 0.4);
    border-radius: 6px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(155, 110, 255, 0.2);
}

.tech-callout-chip-wrapper.left .tech-callout-chip {
    transform: translate(-100%, -100%);
    margin-left: -5px; /* Offset from joint */
    margin-top: -5px;
}

.tech-callout-chip-wrapper.right .tech-callout-chip {
    transform: translate(0, -100%);
    margin-left: 5px; /* Offset from joint */
    margin-top: -5px;
}

/* Mobile responsive specs drawer */
@media (max-width: 900px) {
    .specs-drawer {
        right: 10px;
        left: 10px;
        bottom: 10px;
        width: calc(100% - 20px);
        transform: translateY(0);
        transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    }
    
    .specs-drawer.hidden {
        transform: translateY(100%);
        opacity: 0;
        pointer-events: none !important;
    }
    
    .specs-drawer-card {
        padding: 16px;
        border-radius: 20px;
        padding-top: 24px; /* Space for the handle */
    }
    
    .drawer-drag-handle {
        display: block;
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 5px;
        cursor: grab;
        z-index: 10;
    }

    /* Minimized state by default on mobile */
    .specs-drawer:not(.drawer-expanded) .specs-drawer-card {
        max-height: 200px;
        overflow: hidden;
    }
    
    /* Content is hidden when minimized */
    .specs-drawer:not(.drawer-expanded) #ewi-specs-content,
    .specs-drawer:not(.drawer-expanded) #roofline-specs-content,
    .specs-drawer:not(.drawer-expanded) #iwi-specs-content,
    .specs-drawer:not(.drawer-expanded) #heating-specs-content,
    .specs-drawer:not(.drawer-expanded) #cylinder-specs-content {
        max-height: 160px;
        overflow: hidden;
        pointer-events: none;
        mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    }

    /* Expanded State */
    .specs-drawer.drawer-expanded .specs-drawer-card {
        max-height: calc(100vh - 120px);
    }
    
    .specs-drawer.drawer-expanded #ewi-specs-content,
    .specs-drawer.drawer-expanded #roofline-specs-content,
    .specs-drawer.drawer-expanded #iwi-specs-content,
    .specs-drawer.drawer-expanded #heating-specs-content,
    .specs-drawer.drawer-expanded #cylinder-specs-content {
        max-height: calc(100vh - 160px);
        overflow-y: auto;
        pointer-events: auto;
        mask-image: none;
        -webkit-mask-image: none;
    }
}

/* CIRCULAR VIDEO WIDGET */
.circular-video-widget {
    position: absolute;
    top: 130px; /* Below header, slightly lower */
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
      height: 250px;
    z-index: 2000;
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.circular-video-widget.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.9);
}

@media (min-width: 901px) {
    .circular-video-widget {
        top: auto;
        bottom: 24px;
        left: 24px;
        right: auto;
        transform: none;
        width: 380px;
        height: 380px;
    }
    .circular-video-widget.hidden {
        transform: scale(0.9);
    }
}

.circular-video-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid white;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #000;
}

#circular-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.circular-video-progress-wrapper {
    position: absolute;
    top: -8px;
    left: -8px;
    width: calc(100% + 16px);
    height: calc(100% + 16px);
    pointer-events: none;
}

.circular-video-progress {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circular-video-progress circle {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
}

.circular-video-progress .progress-track {
    stroke: rgba(255, 255, 255, 0.1);
}

.circular-video-progress .progress-fill {
    stroke: var(--brand-purple);
    stroke-dasharray: 653;
    stroke-dashoffset: 653;
    transition: stroke-dashoffset 0.1s linear;
}

.close-circular-video-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(10, 5, 20, 0.9);
    border: 2px solid white;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 2001;
    transition: all 0.3s ease;
}

.close-circular-video-btn:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: rotate(90deg);
}

/* OVERRIDE TAILWIND HIDDEN FOR ANIMATED ELEMENTS */
div.specs-drawer.hidden {
    display: block !important;
    transform: translateY(150%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

div.circular-video-widget.hidden {
    display: block !important;
    transform: translateY(200px) scale(0.5) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* HOTSPOT FADE OUT ANIMATION */
.element-fade-out {
    opacity: 0 !important;
    transform: scale(0.8) !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
    pointer-events: none !important;
}

/* HOTSPOT FADE IN ANIMATION */
.hotspot-label-wrapper, .tech-callout-chip-wrapper, .tech-line, .tech-dot {
    animation: fadeInAnim 0.6s ease forwards;
}

@keyframes fadeInAnim {
    from { opacity: 0; }
    to { opacity: 1; }
}
