/* NovaPro3d Custom Styles */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #111;
    touch-action: none; /* Prevents browser zooming/panning on mobile */
}

/* Top Bar Styles */
#top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 2000;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

#top-bar h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
    margin-right: 10px;
}

.top-bar-right {
    display: flex;
    align-items: center;
}

#hamburger-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    border-radius: 4px;
}

#hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Left Sidebar */
#right-sidebar {
    position: absolute;
    top: 60px;
    left: -350px;
    width: 320px;
    height: calc(100% - 60px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: left 0.3s ease-in-out;
    z-index: 1999;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#right-sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.close-sidebar {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}

.sidebar-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Accordion Styles */
details.accordion-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0;
}

details.accordion-section summary {
    padding: 15px;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    outline: none;
    transition: background 0.2s;
    border-radius: 8px;
}

details.accordion-section[open] summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

details.accordion-section summary::-webkit-details-marker {
    display: none; /* Hide default arrow */
}

details.accordion-section summary::after {
    content: "▼";
    font-size: 0.7rem;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

details.accordion-section[open] summary::after {
    transform: rotate(-180deg);
}

details.accordion-section summary:hover {
    background: rgba(255, 255, 255, 0.05);
}

details.accordion-section summary h3 {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.accordion-content {
    padding: 15px;
}

.sidebar-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-btn-blue {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.sidebar-btn-blue:hover {
    background: rgba(56, 189, 248, 0.25);
}

.sidebar-btn-yellow {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.sidebar-btn-yellow:hover {
    background: rgba(251, 191, 36, 0.25);
}

.sidebar-btn-red {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sidebar-btn-red:hover {
    background: rgba(239, 68, 68, 0.25);
}

.sidebar-btn-green {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.sidebar-btn-green:hover {
    background: rgba(34, 197, 94, 0.25);
}

.project-selector select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 4px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.project-selector select:hover {
    border-color: #38bdf8;
}

.project-selector select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Customizing Potree Sidebar to match our theme */
#potree_sidebar_container {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.potree_menu_toggle {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5); 
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3); 
}

/* Custom Sliders */
.nova-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    margin: 8px 0;
}

.nova-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #38bdf8;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #0f172a;
    box-shadow: 0 0 5px rgba(56, 189, 248, 0.5);
}

.nova-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #38bdf8;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #0f172a;
}

.transparency-control {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 5px;
}

.transparency-control label {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 2px;
}

/* Profile Panel */
/* Potree 1.8 Native Profile Window - element ID is #profile_window */
#profile_window {
    position: fixed !important;
    bottom: 0 !important;
    left: 10px !important;
    right: 10px !important;
    top: auto !important;
    height: 300px !important;
    z-index: 10000 !important;
    background: #111827 !important;
    border: 1px solid #3b82f6 !important;
    border-top: 3px solid #3b82f6 !important;
    border-radius: 8px 8px 0 0 !important;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.5) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    #profile_window {
        left: 5px !important;
        right: 5px !important;
        height: 250px !important;
    }
}

/* Mobile Touch Guide Overlay */
#mobile-touch-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: none; /* hidden by default */
    padding: 20px 30px;
    z-index: 2500;
    gap: 30px;
    pointer-events: none;
    box-shadow: 0 4px 30px rgba(0,0,0,0.6);
    transition: opacity 0.5s ease-out;
}

#mobile-touch-guide.visible {
    display: flex;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#mobile-touch-guide .guide-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    text-align: center;
    font-size: 0.85rem;
    gap: 10px;
}

#mobile-touch-guide .guide-item svg {
    width: 44px;
    height: 62px;
    animation: floatIcon 2s ease-in-out infinite;
}

.guide-item:nth-child(2) svg { animation-delay: 0.2s; }
.guide-item:nth-child(3) svg { animation-delay: 0.4s; }

@keyframes popIn {
    from { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes floatIcon {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

@media (max-width: 768px) {
    #mobile-touch-guide {
        gap: 15px;
        padding: 15px 20px;
        width: 85%;
        box-sizing: border-box;
        justify-content: space-between;
    }
    #mobile-touch-guide .guide-item svg {
        width: 38px;
        height: 54px;
    }
    #mobile-touch-guide .guide-item {
        font-size: 0.75rem;
    }
}
