/* CSS Reset & Variable Definitions */
:root {
    --bg-main: #060b19;
    --bg-panel: rgba(13, 21, 39, 0.85);
    --bg-panel-solid: #0d1527;
    --bg-sidebar: #081023;
    --bg-header: #050a16;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-glow: rgba(153, 126, 255, 0.3);
    
    --text-primary: #f0f4f8;
    --text-secondary: #90a4ae;
    --text-muted: #475569;
    
    --accent-blue: #997eff;
    --accent-orange: #d97706;
    --accent-red: #ef4444;
    --accent-teal: #10b981;
    
    --glow-shadow: 0 0 15px rgba(153, 126, 255, 0.2);
    --glow-shadow-orange: 0 0 15px rgba(217, 119, 6, 0.25);
    --glass-blur: blur(12px);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-speed: 0.25s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* LAYOUT STRUCTURE */
#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* HEADER STYLE */
#app-header {
    display: flex;
    align-items: center;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 24px;
    height: 56px;
    z-index: 10;
}

#app-header .logo {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-primary);
    margin-right: 16px;
}

#app-header .logo-accent {
    color: var(--accent-blue);
    text-shadow: 0 0 10px rgba(153, 126, 255, 0.6);
}

#app-header .subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    border-left: 1px solid var(--text-muted);
    padding-left: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-grow: 1;
}

.header-actions button {
    background: rgba(153, 126, 255, 0.08);
    border: 1px solid rgba(153, 126, 255, 0.3);
    color: var(--accent-blue);
    font-family: var(--font-heading);
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.header-actions button:hover {
    background: rgba(153, 126, 255, 0.2);
    box-shadow: 0 0 10px rgba(153, 126, 255, 0.3);
    transform: translateY(-1px);
}

/* MAIN LAYOUT BODY */
#main-content {
    display: block;
    position: relative;
    flex-grow: 1;
    height: calc(100vh - 56px - 44px); /* Subtract Header and Footer Shelf collapsed heights */
    overflow: hidden;
    transition: height var(--transition-speed) ease;
}

/* SIDEBARS */
.sidebar {
    width: 320px;
    background-color: rgba(8, 16, 35, 0.7) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    box-shadow: var(--glow-shadow);
    display: flex;
    flex-direction: column;
    height: calc(100% - 30px);
    z-index: 100;
    position: absolute;
    top: 15px;
    border-radius: 8px;
    transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1),
                opacity var(--transition-speed) ease;
}

#left-sidebar {
    left: 15px;
}

#right-sidebar {
    right: 15px;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.sidebar-header h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tenant Banner */
.tenant-banner {
    display: flex;
    align-items: center;
    background-color: rgba(13, 21, 39, 0.45);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    height: 52px;
    flex-shrink: 0;
}

.tenant-logo-wrapper {
    width: 58px;
    height: 22px;
    background-color: #ffffff;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.tenant-logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 8px;
    letter-spacing: 0.5px;
    color: #0b1329;
}

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

.tenant-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.tenant-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 700;
    color: var(--accent-teal);
    margin-top: 1px;
}

.tenant-status-dot {
    width: 5px;
    height: 5px;
    background-color: var(--accent-teal);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 5px var(--accent-teal);
}

.sidebar-scroll {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

/* SIDEBAR EMPTY / PLACEHOLDER STATE */
.sidebar-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    height: 100%;
    gap: 16px;
}

.sidebar-empty-state i {
    font-size: 42px;
    color: rgba(255, 255, 255, 0.05);
}

.sidebar-empty-state p {
    font-size: 13px;
    line-height: 1.6;
}

/* CONTROL SECTIONS & FORM ELEMENTS */
.control-section {
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 20px;
}

.control-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.control-section h3 {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-blue);
    margin-bottom: 16px;
}

.control-group {
    margin-bottom: 16px;
}

.control-group:last-child {
    margin-bottom: 0;
}

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

.slider-header label {
    font-size: 12px;
    color: var(--text-secondary);
}

.badge {
    background: rgba(153, 126, 255, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(153, 126, 255, 0.2);
    padding: 2px 6px;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

.range-hint {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

/* CUSTOM RANGE SLIDER STYLING */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

input[type=range]::-webkit-slider-thumb {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -4px;
    box-shadow: 0 0 5px var(--accent-blue);
    transition: all 0.15s ease;
}

input[type=range]:active::-webkit-slider-thumb {
    transform: scale(1.3);
    box-shadow: 0 0 10px var(--accent-blue);
}

/* SLICING ACTIVE BADGES */
.badge.active {
    background: rgba(255, 115, 0, 0.15);
    color: var(--accent-orange);
    border-color: rgba(255, 115, 0, 0.3);
}

/* TOGGLES / SWITCHES */
.toggle-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 10px 12px;
}

.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-label {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.toggle-label strong {
    font-size: 12px;
    color: var(--text-primary);
}

.toggle-label small {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-top: 2px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

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

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 18px;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .4s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: rgba(153, 126, 255, 0.2);
}

.switch input:checked + .slider:before {
    transform: translateX(14px);
    background-color: var(--accent-blue);
    box-shadow: 0 0 5px var(--accent-blue);
}

/* 3D VIEWPORT */
#viewport-container {
    flex-grow: 1;
    height: 100%;
    position: relative;
    background: #bfbfbf;
}

#canvas-container {
    width: 100%;
    height: 100%;
}

/* GLASS PANEL OVERLAYS ON CANVAS */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    box-shadow: var(--glow-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 8px;
}

#viewport-overlay {
    position: absolute;
    top: 15px;
    left: 350px; /* Offset when left-sidebar is open */
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(20, 26, 33, 0.85);
    border-radius: 6px;
    transition: left var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
}

#left-sidebar.collapsed ~ #viewport-container #viewport-overlay {
    left: 15px;
}

#priority-scale-overlay {
    position: absolute;
    top: 15px;
    right: 350px; /* Offset when right-sidebar is open */
    height: calc(100% - 30px);
    width: 72px;
    z-index: 10;
    display: flex;
    flex-direction: row;
    padding: 8px 6px;
    gap: 5px;
    background: rgba(20, 26, 33, 0.85);
    border-radius: 8px;
    align-items: center;
    transition: right var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

#right-sidebar.collapsed ~ #viewport-container #priority-scale-overlay {
    right: 15px;
}

#viewport-actions {
    position: absolute;
    top: 15px;
    right: 435px; /* Offset when right-sidebar is open */
    z-index: 15;
    display: flex;
    gap: 8px;
    transition: right var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
}

#right-sidebar.collapsed ~ #viewport-container #viewport-actions {
    right: 100px; /* Offset when right-sidebar is collapsed */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-secondary);
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.color-dot.collar {
    background-color: var(--accent-blue);
    box-shadow: 0 0 6px var(--accent-blue);
}

.color-dot.target-point {
    background-color: var(--accent-orange);
    box-shadow: 0 0 6px var(--accent-orange);
}

#heatmap-legend {
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.heatmap-gradient {
    width: 150px;
    height: 8px;
    background: linear-gradient(to right, #0055ff, #00ffaa, #ffff00, #ff5e00, #ff0000);
    border-radius: 4px;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.1);
}

.legend-range {
    font-size: 9px;
    color: var(--text-muted);
}

/* TOOLTIP STYLING */
.tooltip {
    position: absolute;
    padding: 10px 14px;
    font-size: 12px;
    pointer-events: none;
    display: none;
    z-index: 100;
    transition: opacity 0.15s ease;
    border-color: var(--border-color-glow);
    max-width: 200px;
}

.tooltip h4 {
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--accent-blue);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.tooltip p {
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-size: 11px;
}

.tooltip p:last-child {
    margin-bottom: 0;
}

/* INSPECTOR / DETAILS SIDEBAR PANEL */
.target-badge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 24px;
}

.rank-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(153, 126, 255, 0.08);
    border: 1px solid rgba(153, 126, 255, 0.2);
    font-size: 10px;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    text-transform: uppercase;
}

.rank-circle span {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-blue);
    line-height: 1.1;
}

.priority-score-box {
    text-align: right;
}

.score-label {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.score-val {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-orange);
    text-shadow: 0 0 10px rgba(255, 115, 0, 0.3);
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.metric-val {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 4px 0;
}

.metric-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.metric-progress-bar .fill {
    height: 100%;
    border-radius: 2px;
    width: 0;
    transition: width 0.4s ease-out;
}

#prob-bar {
    background-color: var(--accent-teal);
    box-shadow: 0 0 4px var(--accent-teal);
}

#uncertainty-bar {
    background-color: var(--accent-orange);
    box-shadow: 0 0 4px var(--accent-orange);
}

/* STRUCTURAL DIRECTION INDICATORS */
.structural-indicators {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.indicator {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.indicator-title {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
    text-align: center;
}

.indicator-title span {
    color: var(--text-primary);
    font-weight: 600;
}

.canvas-wrap {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* COORDINATE DETAIL TABLES */
.coord-table {
    width: 100%;
    border-collapse: collapse;
}

.coord-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.coord-table tr:last-child {
    border-bottom: none;
}

.coord-table th {
    text-align: left;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    padding: 8px 0;
    width: 45%;
}

.coord-table td {
    text-align: right;
    font-size: 12px;
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--text-primary);
    padding: 8px 0;
}

/* BOTTOM COLLAPSIBLE SHELF */
#app-footer {
    background-color: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 8;
}

.shelf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 24px;
    height: 44px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    user-select: none;
}

.shelf-header h3 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.shelf-header h3 span {
    color: var(--accent-blue);
}

.toggle-shelf {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s ease;
}

.toggle-shelf:hover {
    color: var(--accent-blue);
}

.shelf-content {
    height: 0;
    overflow: hidden;
    transition: height var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 0 solid var(--border-color);
}

.shelf-content.expanded {
    height: 280px;
    border-top-width: 1px;
}

/* DATA TABLE STYLING */
.table-scroll {
    overflow: auto;
    height: 100%;
    padding: 10px 24px 20px 24px;
}

#targets-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

#targets-table th, #targets-table td {
    padding: 10px 12px;
    font-size: 12px;
}

#targets-table th {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: var(--bg-sidebar);
    user-select: none;
}

#targets-table th.sortable {
    cursor: pointer;
}

#targets-table th.sortable:hover {
    color: var(--accent-blue);
}

#targets-table th.active {
    color: var(--accent-blue);
}

#targets-table th.active i {
    font-size: 10px;
}

#targets-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.15s ease;
}

#targets-table tbody tr:hover {
    background: rgba(153, 126, 255, 0.03);
    color: var(--accent-blue);
}

#targets-table tbody tr.selected {
    background: rgba(153, 126, 255, 0.08) !important;
    border-left: 3px solid var(--accent-blue);
    color: var(--accent-blue);
    font-weight: 500;
}

#targets-table tbody tr.dimmed {
    opacity: 0.3;
}

.rank-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

#targets-table tbody tr.selected .rank-badge {
    background: var(--accent-blue);
    color: var(--bg-main);
}

.table-priority {
    font-weight: 600;
}

/* UTILS */
.hidden {
    display: none !important;
}

/* Custom Scrollbar for sidebars and tables */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Dynamic occurrences list items */
.occ-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 115, 0, 0.06);
    border: 1px solid rgba(255, 115, 0, 0.15);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    animation: fadeIn 0.2s ease-out;
}
.occ-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.occ-item-label {
    font-weight: 600;
    color: var(--text-primary);
}
.occ-item-coords {
    font-size: 10px;
    color: var(--text-secondary);
    font-family: monospace;
}
.occ-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: color 0.15s ease;
    padding: 2px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.occ-delete-btn:hover {
    color: var(--accent-red);
}

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

/* --- VISIBILITY AND DEM STYLING --- */
.layer-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: #94a3b8;
    margin-top: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 4px;
}

.compact-toggle {
    margin-bottom: 6px !important;
}

.compact-toggle .toggle-label {
    font-size: 12px !important;
}

.compact-toggle .switch {
    transform: scale(0.85);
    transform-origin: right center;
}

.planes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 6px;
}

.plane-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: all 0.15s ease;
    user-select: none;
}

.plane-checkbox:hover {
    border-color: rgba(255, 115, 0, 0.25);
    background: rgba(255, 115, 0, 0.03);
    color: var(--text-main);
}

.plane-checkbox input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--accent-orange);
}

.dem-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.dem-upload-area:hover, .dem-upload-area.hover {
    border-color: var(--accent-orange);
    background: rgba(255, 115, 0, 0.04);
}

.dem-upload-area.success {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.04);
}

/* ==========================================================================
   PANEL COLLAPSE & FULLSCREEN INTERACTION STYLES
   ========================================================================== */

/* Slide Transition on Main Sidebars */
.sidebar {
    transition: width var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
                min-width var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
                opacity var(--transition-speed) ease;
}

/* Sidebar Collapsed States */
#left-sidebar.collapsed {
    transform: translateX(calc(-100% - 30px));
    opacity: 0;
    pointer-events: none;
}

#right-sidebar.collapsed {
    transform: translateX(calc(100% + 30px));
    opacity: 0;
    pointer-events: none;
}

/* Sidebar Header Collapse Triggers */
.sidebar-collapse-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.sidebar-collapse-btn:hover {
    color: var(--accent-blue);
    background: rgba(153, 126, 255, 0.08);
}

/* Floating Expand Panels inside Viewport */
.floating-expand-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(20, 26, 33, 0.85);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.floating-expand-btn.right-edge {
    right: 15px;
}

.floating-expand-btn.left-edge {
    left: 15px;
}

.floating-expand-btn:hover {
    background: rgba(153, 126, 255, 0.15);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: var(--glow-shadow);
}

/* Premium Glass Viewport Action Buttons */
.glass-btn {
    background: rgba(20, 26, 33, 0.85);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.glass-btn:hover {
    background: rgba(153, 126, 255, 0.18);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: var(--glow-shadow);
    transform: translateY(-1px);
}

/* Fullscreen / Maximized Mode */
#viewport-container.fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
}

/* Project Importer Elements */
.upload-select-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    text-align: left;
    transition: all 0.2s ease;
}

.upload-select-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
    background: rgba(153, 126, 255, 0.03);
}

.upload-select-btn-sm {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 5px 8px;
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    text-align: left;
    transition: all 0.15s ease;
}

.upload-select-btn-sm:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--border-color);
}

.action-btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), #0090ff);
    color: #050a0e;
    border: none;
    border-radius: 4px;
    padding: 10px 16px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 15px rgba(153, 126, 255, 0.25);
}

.action-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(153, 126, 255, 0.4);
    filter: brightness(1.1);
}

.action-btn-primary:active {
    transform: translateY(0);
}

/* INTERACTIVE EDITABLE VALUE BADGES */
.badge-input-container {
    display: inline-flex;
    align-items: center;
    background: rgba(153, 126, 255, 0.08);
    border: 1px solid rgba(153, 126, 255, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
    transition: all var(--transition-speed) ease;
}

.badge-input-container:focus-within {
    background: rgba(153, 126, 255, 0.15);
    border-color: var(--accent-blue);
    box-shadow: 0 0 5px rgba(153, 126, 255, 0.3);
}

.badge-input {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    width: 32px;
    text-align: right;
    padding: 0;
    margin: 0;
    outline: none;
}

.badge-input::-webkit-outer-spin-button,
.badge-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.badge-input {
    -moz-appearance: textfield;
}

.badge-unit {
    color: var(--accent-blue);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    margin-left: 2px;
    pointer-events: none;
}

/* PREVENT OVERLAYS FROM BLOCKING VIEWPORT CLICKS */
#priority-scale-overlay {
    pointer-events: none;
}

/* INTERACTIVE FILE DRAG & DROPZONES */
.file-dropzone {
    border: 1.5px dashed rgba(153, 126, 255, 0.3);
    background: rgba(153, 126, 255, 0.02);
    border-radius: 8px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.file-dropzone:hover, .file-dropzone.dragover {
    border-color: var(--accent-blue);
    background: rgba(153, 126, 255, 0.07);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

.file-dropzone.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.04);
}

.file-dropzone-icon {
    font-size: 20px;
    color: var(--accent-blue);
    transition: transform 0.2s ease;
}

.file-dropzone.success .file-dropzone-icon {
    color: #10b981;
}

.file-dropzone:hover .file-dropzone-icon, .file-dropzone.dragover .file-dropzone-icon {
    transform: translateY(-2px);
}

.file-dropzone-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    pointer-events: none;
}

.file-dropzone-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* CENTERED CAMERA PRESETS HUD */
#camera-presets-hud {
    display: flex;
    gap: 6px;
    background: rgba(13, 21, 39, 0.8) !important;
    padding: 5px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glow-shadow);
    z-index: 1000;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
}

.camera-preset-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-family: var(--font-body);
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.camera-preset-btn i {
    font-size: 12px;
}

.camera-preset-btn:hover {
    color: var(--accent-blue);
    background: rgba(153, 126, 255, 0.08);
}

.camera-preset-btn.active {
    color: var(--text-primary);
    background: rgba(153, 126, 255, 0.15);
    border: 1px solid rgba(153, 126, 255, 0.25);
    box-shadow: 0 0 8px rgba(153, 126, 255, 0.1);
}

/* Responsive Table Adaptive Reflow for Embedded SaaS Views */
@media (max-width: 1050px) {
    .hide-compact {
        display: none !important;
    }
}

/* Custom Collapsible Details for Project Importer */
details.project-importer summary::-webkit-details-marker {
    display: none !important;
}
details.project-importer summary {
    list-style: none !important;
}
details.project-importer[open] .details-chevron {
    transform: rotate(180deg);
}



