:root {
    --primary-dark: #202020;
    --secondary-dark: #2a2a2a;
    --accent-blue: #2196F3;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --panel-bg: rgb(32, 32, 32);
    --border-color: #3a3a3a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: var(--primary-dark);
    color: var(--text-primary);
    overflow: hidden;
}

/* Main Layout */
.editor-container {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    grid-template-rows: 40px 1fr 200px;
    height: 100vh;
    gap: 1px;
    background: var(--border-color);
}

/* Top Toolbar */
.toolbar {
    grid-column: 1 / -1;
    background: var(--panel-bg);
    display: flex;
    height: 6%;
    width: 100%;
    line-height: 40px;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    align-items: center;
    padding: 0 10px;
    gap: 10px;
}

.toolbar-group {
    display: flex;
    gap: 5px;
    padding: 0 8px;
    border-right: 1px solid var(--border-color);
}


.tool-button {
    background: transparent;
    color: #F5F5F5;
    padding: 3px 4px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.3s ease;
    text-align: center;
    border: none;
}

/* Active/selected state */
.tool-button.active , .camera-tool-button.acttive {
    background-color: #0099ff;
    border-color: var(--accent-blue);
    border-radius: 4px;
    color: #FFFFFF;
    box-shadow: var(--button-active-shadow);
    transform: translateY(0);
}

/* Disabled state for completeness */
.tool-button:disabled {
    background: linear-gradient(145deg, #555, #444);
    border-color: #555;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Left Panel - Hierarchy */
.inspector-panel {
   flex-grow: 1;
   position: absolute;
   z-index: 3;
   right: 0;
   height: 93.6vh;
   overflow-y: auto;
   width: 23%;
   top: 6.1vh;
   border-left: 1px solid var(--border-color);
   background: var(--panel-bg);
   display: flex;
   flex-direction: column;
   transition: width 0.3s ease; /* Smooth transition */
}

/*
.panel-header {
    cursor: pointer;
    padding: 10px;
    background: var(--secondary-dark);
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
}*/

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background-color: #222;
    border-bottom: 1px solid #444;
    color: #eee;
    cursor: pointer;
}

.expand-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.hierarchy-panel {
    background: var(--panel-bg);
    position: absolute;
    z-index: 9;
    left: 0;
    top: 6.4vh;
    height: 93.6vh;
    width: 20%; /* Default width */
    min-width: 20%;
    max-width: 50vw;
    font-size: 12px;
    /*overflow-y: auto;*/
    border-right: 1px solid var(--border-color);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    --panel-bg: #1e1e1e;
    --border-color: #4b4b4b;
}


.resize-handle-hierarchy {
    position: absolute;
    right: 0;
    top: 0;
    width: 4px;
    height: 100%;
    cursor: ew-resize;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s ease;
}

.resize-handle:hover {
    background: rgba(255, 255, 255, 0.4);
}

.property-group {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.property-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 10px;
    align-items: center;
    margin: 5px 0;
}

.property-label {
    color: var(--text-secondary);
}

.property-input {
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    width: 100%;
    margin: 10px auto
}

/* Viewport */
.renderer-container{
    background: var(--primary-dark);
    position: absolute;
    width: 80%;
    height: 90%; 
    top: 6vh;
    right: 0;
    /*   left: 20%;
    transform: translate(-50%);*/
}

/*.renderer-container{
    width: 80%;
    height: 78%; 
    transition: height 0.3s ease;
}*/

.close-button {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    margin-left: auto;
}

/* Status Bar */
.status-bar {
    width: 100%;
    background: var(--panel-bg);
    padding: 5px 10px;
    display: flex;
    border-top: 1px solid var(--border-color);
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    transition: height 0.3s ease, width 0.3s ease, left 0.3s ease, transform 0.3s ease;
}


/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

.material-editor {
    background: var(--panel-bg);
}


/* When inspector is hidden */
.inspector-panel.closed {
   width: 0; /* Hide the inspector */
}


/* Advanced Timeline */
.timeline-markers {
    position: relative;
    height: 30px;
    background: var(--secondary-dark);
    margin: 5px 0;
}

/*
.layer {
    display: flex;
    align-items: center;
    padding: 5px;
    cursor: pointer;
}

.layer:hover {
    background: var(--secondary-dark);
}
*/

/* Snapping Guidelines */
.guideline {
    position: absolute;
    background: var(--accent-blue);
    pointer-events: none;
}

.guideline.vertical {
    width: 1px;
    height: 100%;
}

.guideline.horizontal {
    height: 1px;
    width: 100%;
}


/* History Panel Styling */
.history-panel {
    position: relative;
    width: 100%;
    max-height: 40vh;
    background: var(--primary-dark); 
    color: white;
    padding: 5px;
    font-family: 'Arial', sans-serif; 
    overflow-y: auto;
}

.panel-header i {
    color: #2196F3;
}

#history-items {
    width: 100%;
}

.history-item {
    padding: 7px 8px;
    font-size: 12px; 
    width: 250px;
    color: #2196F3;
    cursor: pointer;
    transition: background 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Hover State for History Items */
.history-item:hover {
    background: var(--secondary-dark); /* Hover background from your theme */
    color: #BBDEFB; /* Lighter blue on hover for contrast */
}

/* Ensure the last item has no bottom border */
.history-item:last-child {
    border-bottom: none;
}

/* Optional: Style the scrollbar for a professional look */
.history-panel::-webkit-scrollbar {
    width: 8px;
}

.history-panel::-webkit-scrollbar-track {
    background: var(--primary-dark);
    border-radius: 4px;
}

.history-panel::-webkit-scrollbar-thumb {
    background: var(--secondary-dark);
    border-radius: 4px;
}

.history-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}
/* Advanced Tools Panel */
.advanced-tools {
    margin-top: 20px;
    background: var(--panel-bg);
    padding: 10px;
}

/* Performance Metrics */
.performance-metrics {
    position: absolute;
    bottom: 30px;
    right: 10px;
    background: var(--panel-bg);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.panel {
    background: #333;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Export Options */
.export-panel {
    background: #2c2a2a;
    padding: 10px;
    margin: 10px;
}

.export-options {
    margin-top: 10px;
    padding: 10px;
    border-top: 1px solid #3a3a3a;
}

.export-options label {
    display: block;
    margin: 5px 0;
    color: #ddd;
}

.property-input {
    background: #3a3a3a;
    border: 1px solid #4a4a4a;
    color: #fff;
    padding: 5px;
    border-radius: 4px;
    width: 100%;
    margin-bottom: 10px;
}

.export-meth{
    padding: 1rem;
}

.context-menu {
    position: fixed;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 0;
    font-size: 12px;
    display: none;  /* Initially hidden */
    z-index: 1000;  /* Ensure it's above other content */
}

.context-menu-item {
    padding: 5px 20px;
    border: 1px solid #252525;
    cursor: pointer;
}

.context-menu-item:hover {
    background: var(--secondary-dark);
}

.sub-menu { 
    display: none;  
    position: absolute;
    left: 100%;  
    width: 90%;
    font-size: 12px;
    background: #222;
    border: 1px solid #444;
    z-index: 1003;
}

/* Hover effect to show the sub-menu */
.context-menu-item:hover .sub-menu {
    display: block;  /* Show the sub-menu when hovering over parent item */
}

/*New feautures*/
.panel {
    background: var(--panel-bg);
    border-radius: 4px;
    margin-bottom: 10px;
}


.panel-content {
    padding: 10px;
}

.input-group {
    margin-bottom: 8px;
}



.input-group label {
    display: block;
    margin-bottom: 4px;
}

.input-group input {
    width: 100%;
    padding: 4px;
    background: #444;
    border: 1px solid #555;
    color: white;
}


.panel-button{
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    border: 2px solid var(--border-color);
    background: #2a2a2a;
    padding: 5px 8px;
    color: #ffffff;
    margin: 5px auto;
    cursor: pointer;
}

.button-container {
    display: flex; /* Use flexbox to arrange buttons horizontally */
    flex-direction: row; /* Ensure horizontal alignment */
    gap: 10px; /* Optional: Add spacing between buttons */
    margin: 10px auto;
    overflow-x: auto;
}

.panel-button-tool {
    background-color: #383838;
    cursor: pointer;
    border: 2px solid var(--border-color);
    display: flex; /* Enable flexbox for centering SVG inside button */
    justify-content: center; /* Center SVG horizontally */
    align-items: center; /* Center SVG vertically */
    width: 35px;
    height: 35px;
    padding: 0; /* Remove padding for proper centering */
}


.panel-button-tool svg {
    color: white;
    display: block; /* Ensure SVG behaves as a block element */
    width: 24px; /* Match SVG width */
    height: 24px; /* Match SVG height */
}

.light-preview {
    width: 50px;
    height: 50px;
    border: 1px solid #555;
    margin: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hdri-preview {
    width: 80px;
    height: 45px;
    background-size: cover;
    margin: 5px;
    display: inline-block;
    border: 1px solid #555;
}

.model-preview {
    width: 80px;
    height: 80px;
    background: #444;
    margin: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #555;
}

.stats {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 4px;
}

.tool-options {
    margin: 10px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.panel-button.active {
    background-color: #0598fa;
    box-shadow: 0 0 10px rgba(45, 180, 171, 0.5);
    color: white;
}

.history-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.tool-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

#symmetryAxis {
    margin-top: 5px;
    width: 100%;
    padding: 4px;
}

.controls-panel {
    position: fixed;
    right: 10px;
    top: 10px;
    background: #2d2d2d;
    padding: 15px;
    border-radius: 8px;
    color: white;
}


.camera-preview {
    position: fixed;
    z-index: 1001;
    bottom: 20px;
    right: 20px;
    width: 23%;
    height: 25%;
    border: 2px solid #666;
    resize: both;
    overflow: hidden;
    background: #000;
    transition: all 0.3s ease;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: grab;
    min-width: 150px;
    min-height: 100px;
}
    
.camera-preview.hidden {
    display: none;
}
.camera-preview.expanded {
    width: 100%;
    height: 100%;
    border-radius: 0;
}
    
.camera-preview.minimized {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    overflow: hidden;
}
    
.preview-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 100;
    display: flex;
    gap: 5px;
}

.minimizePreview, .expandPreview {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    color: white;
    border-radius: 5px;
    transition: 0.2s;
}
    
.minimizePreview,:hover .expandPreview:hover {
    background: rgba(255, 255, 255, 0.4);
}

.light-controls {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 4px;
}

.control-group {
    margin: 5px 0;
}

#toolbar button {
    color: white;
    border: none;
    cursor: pointer;
}

#toolbar button:hover {
    background: #2a2a2a;
}

#editOptions{
    position: absolute;
    margin-top: 30px;
    margin-left: 5%;
    padding: 1rem;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.1);
    border: 1px solid #444;
    background-color: #333;
    z-index: 100;
    color: wheat;
}

.editMode{
    background-color: #202020;
    padding: 4px 6px;
    border: none;
}

#brush-panel{
    height: auto;
    overflow-y: auto;
    padding: 10px;
}

.brush-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.brush-section h3 {
    margin-bottom: 15px;
    color: #4A90E2;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brush-section h3::before {
    content: '';
    width: 4px;
    height: 16px;
    background: #4A90E2;
    display: inline-block;
    border-radius: 2px;
}

.control-group {
    flex: 1;
}

.slider-container {
    display: flex;
    flex-direction: column;
    margin: 8px 0;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.slider-header label {
    font-size: 13px;
    color: #ccc;
}

.slider-value {
    font-size: 13px;
    color: #4A90E2;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(74, 144, 226, 0.2);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #4A90E2;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.file-upload {
    position: relative;
    overflow: hidden;
    margin: 10px 0;
}

.file-upload input[type="file"] {
    position: absolute;
    font-size: 100px;
    right: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-btn {
    background: rgba(74, 144, 226, 0.2);
    border: 1px dashed #4A90E2;
    padding: 12px;
    border-radius: 6px;
    color: #4A90E2;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}

.file-upload-btn:hover {
    background: rgba(74, 144, 226, 0.3);
}
.node-property[data-show-when] {
display: none;
margin: 8px 0;
}

.node-property input[type="text"],
.node-property input[type="number"],
.node-property select {
    background-color: #2c2c2c;
    color: #ddd;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px 6px;
    width: 100px; /* Adjust as needed */
    box-sizing: border-box;
}

.node-property input[type="color"] {
    padding: 0;
    width: 30px;
    height: 20px;
    border-radius: 4px;
}
.node-property input[type="range"] {
    flex-grow: 1;
    margin: 0 5px;
}

.node-property input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #4caf50;
    border-radius: 50%;
    cursor: pointer;
}

.node-property input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: #555;
    border-radius: 2px;
}

.node-property .value-display {
    min-width: 30px;
    text-align: right;
    color: #bbb;
}

.vector3-input {
    display: flex;
    gap: 4px;
}
.vector3-input input {
    width: 45px !important; /* Override general width */
    text-align: center;
}


.brush-controls {
    margin: 10px auto;
    padding: 10px;
    background-color: #2a2a2a;
    width: 100%;
}

.brush-button {
    background: rgba(74, 144, 226, 0.2);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: 0.3s;
    margin-right: 2rem; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.brush-button:hover {
    background: rgba(74, 144, 226, 0.4);
}

.brush-button.active {
    background: #4A90E2;
}

#brush-preview {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
}

.brush-mode {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.mode-btn {
    flex: 1;
    padding: 8px;
    background: rgba(74, 144, 226, 0.2);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.mode-btn.active {
    background: #4A90E2;
}



.node-editor {
    display: none;
    position: absolute;
    top: 41%;
    left: 48.5%;
    transform: translate(-50%, -50%);
    width: 56.9%;
    height: 70vh;
    max-height: 70vh;
    min-width: 400px;
    background: #2a2a2a;
    border: 1px solid #444;
    z-index: 1000;
    overflow: hidden;
    transition: width 0.3s ease, left 0.3s ease, transform 0.3s ease;
    resize: horizontal;
    user-select: none; 
}


#node-editor-close {
    width: 30px;
    height: 25px;
    background-color: red;
    color: #fff;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: none;
    font-size: 16px;
    cursor: pointer;
}

.node-editor.expanded {
    width: 80%;
    left: 20%;
    transform: translate(0, -50%);
}

.node-editor.visible {
    display: block;
}


.node-editor-header {
    background: #1a1a1a;
    padding: 8px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-weight: bold;
    user-select: none;
}

.node-toolbar {
    position: absolute;
    top: 40px;
    left: 0;
    z-index: 1;
    background: #1a1a1a;
    padding: 8px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #444;
}

.toolbar-button {
    background: #3a3a3a;
    border: 1px solid #555;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-button:hover {
    background: #4caf50;
    border-color: #4caf50;
    transform: scale(1.1);
}

.node-canvas {
    position: relative;
    width: 100%;
    height: 100vh; /* Or your desired height */
    background: #222;
    overflow: hidden;
}


/* Improved node styling */
.node {
    position: absolute;
    min-width: 120px;
    background-color: #3d3d3d;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 0; /* Remove padding, control with inner elements */
    box-shadow: 3px 3px 10px rgba(0,0,0,0.3);
    cursor: default; /* Default for node, changes on header for drag */
    transition: box-shadow 0.2s ease-out;
    user-select: none;
    z-index: 10;
}

.node.selected {
    border: 1px solid #0af;
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.5);
}
        
        
svg {
    z-index: 12; /* Connections above nodes and grid */
}

.node:hover {
    border-color: #4caf50;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.node-title {
    background: linear-gradient(90deg, #444, #383838);
    padding: 4px 6px;
    font-weight: bold;
    font-size: 1em;
    color: #fff;
}

.node-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Space between properties */
}

.node-socket {
    width: 14px;
    height: 14px;
    background-color: #666;
    border: 1px solid #888;
    border-radius: 50%;
    position: absolute;
    cursor: crosshair;
    transition: background-color 0.2s, transform 0.1s;
}
.node-socket.input {
    left: -7px; /* Center on edge */
    top: 50%; /* Placeholder, position dynamically or with flex */
    transform: translateY(-50%);
    background-color: #00aeff; /* Blue for input */
}
.node-socket.output {
    right: -7px; /* Center on edge */
    top: 50%; /* Placeholder */
    transform: translateY(-50%);
    background-color: #ff8c00; /* Orange for output */
}

.node-socket.hover {
    background-color: #fff;
    transform: translateY(-50%) scale(1.2);
}

.node-socket:hover,
.node-socket.active {
    transform: scale(1.2);
    background: #4caf50;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.toolbar-button[data-type="effect"] {
    animation: pulse 2s infinite;
    background-color: #2a5d8a;
}

.toolbar-button[data-type="effect"]:hover {
    background-color: #3a6d9a;
    animation: none;
}

/* Water effect specific styles */
.node-property[data-show-when="type=Water"] {
    border-left: 2px solid #0088ff;
    padding-left: 5px;
    margin-left: -5px;
}

.node-property {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.node-property:hover {
    background: #404040;
    transform: translateX(2px);
}

.node-socket.property-socket {
    margin-right: 6px;
}

.node-socket.property-socket:hover,
.node-socket.property-socket.active {
    transform: scale(1.2);
    background: #4caf50;
}

.node-property label {
    margin-right: 8px;
    color: #ccc;
    white-space: nowrap;
}

/* When input is focused, highlight the label */
.node-property input:focus + label,
.node-property select:focus + label {
    color: #4caf50;
}

.node-connection {
    transition: stroke 0.1s ease-out;
    position: absolute;
    pointer-events: none;
    z-index: -1;
}

.node-connection.selected {
    stroke: #00ccff !important; /* Override JS for selected connections if needed */
    /* filter: drop-shadow(0 0 3px #00ccff); */ /* Can be performance intensive */
}

/* Dynamic positioning for sockets if content height varies */
/* This would be better handled by JS calculating positions or using flex layout */
.node-content + .node-socket.output,
.node-header + .node-socket.input { /* If sockets are direct children after header/content */
    /* Adjust top based on content, or use JS */
}


/* Example for specific property spacing (e.g., vector3) */
.node-property .vector3-input input {
    width: calc(33% - 3px); /* Distribute width in vector3 */
}

.node-property input,
.node-property select {
    background: #4a4a4a;
    border: 1px solid #606060;
    color: #fff;
    padding: 5px;
    border-radius: 3px;
    width: 80px;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.node-property input:focus,
.node-property select:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.3);
}

.context-menu1 {
    position: fixed;
    background: #222;
    border: 1px solid #4f4f4f;
    padding: 0;
    font-size: 12px;
    z-index: 1003;
}

.context-menu-item1 {
    padding: 4px 12px;
    cursor: pointer;
    color: #fff;
}

.context-menu-item1:hover {
    background: #333;
}

/* تصميم الأزرار */
#render-container{
    position: absolute;
    top:0%; /* الموضع العلوي */
    right: 26%; /* الموضع من اليمين */
    width: 90px;
    height: 90px;
    display: flex;
    z-index: 1;
    padding: 8px;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease;
}

.axis-controls {
    position: relative;
    top:9%; /* الموضع العلوي */
    right: 25%; /* الموضع من اليمين */
    width: 90px;
    height: 90px;
    display: flex;
    z-index: 1;
    padding: 8px;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease;
}
/*
.axis-controls.expanded {
    right: -33%;
}
*/
#render-container.expanded {
    right: 8px; /* عند التوسيع */
}

/* الخطوط البيضاء بين المحاور */
#axis-controls::before {
    content: '';
    position: absolute;
    width: 2px; /* عرض الخط العمودي */
    height: 80%; /* طول الخط العمودي */
    background-color: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#axis-controls::after {
    content: '';
    position: absolute;
    width: 20%; /* طول الخط الأفقي */
    height: 2px; /* عرض الخط الأفقي */
    background-color: white;
    z-index: -1;
    top: 50%;
    left: 60%;
    transform: translate(-50%, -50%);
}

/* الأزرار الدائرية */
.axis-button {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    font-size: 12px;
    font-weight: bold;
    color: white;
    cursor: pointer;

    transition: transform 0.2s ease;
}

#axis-x {
    background-color: #e74c3c; 
    top: 45%;
    left: 75%;
    transform: translate(-50%, -50%);
}

#axis-y {
    background-color: #2ecc71; 
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#axis-z {
    background-color: #3498db; /* الأزرق لمحور Z */
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#top{
    background-color: #dbb434; 
    top: 70%;
    left: 18%;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: none;
    transform: translate(-50%, -50%);
}

#bottom{
    background-color: #d534db; 
    top: 48%;
    left: 0%;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: none;
    transform: translate(-50%, -50%);
}

#diagonal{
    background-color: #42db34;
    top: 25%;
    left: 18%;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: none;
    transform: translate(-50%, -50%);
}

/* تأثير عند التمرير */
.axis-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.axis-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.toggle-look{
    position: absolute;
    top: 27%; 
    font-size: 18px;
    background-color: transparent;
    cursor: pointer; 
    color: #fff;
    justify-content: center;
    align-items: center;
    text-align: center;
    left: 15px;
    width: 30px;
    height: 30px;
    padding: 5px;
    border: none;
}

.physics-controls {
    background: var(--panel-bg);
    padding: 15px;
    border-radius: 8px;
    color: white;
    font-family: Arial, sans-serif;
    min-width: 250px;
}
.control-group {
    margin: 10px 0;
}
.slider-container {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.force-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.force-button {
    background: #4CAF50;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}
.force-button:hover {
    background: #45a049;
}


.property-group1{
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 1rem;
}


#time-display {
    font-family: monospace;
    font-size: 14px;
    color: white;
    padding: 4px 8px;
    background: #333;
    border-radius: 3px;
}



.timeline-scale {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 24px;
    background: #333;
    display: flex;
    align-items: flex-end;
    transform-origin: left;
}



.timeline-scale-marker {
    position: absolute;
    width: 1px;
    height: 6px;
    background: #666;
    bottom: 0;
}

.timeline-scale-marker.major {
    height: 12px;
    background: #888;
}

.timeline-scale-label {
    position: absolute;
    bottom: 14px;
    transform: translateX(-50%);
    color: #888;
    font-size: 10px;
    font-family: monospace;
}



.recording-segment {
    position: absolute;
    height: 32px;
    background: linear-gradient(to right, #ff4444, #ff6b6b);
    top: 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}

.recording-segment:hover {
    background: linear-gradient(to right, #ff6b6b, #ff8787);
}

.recording-segment.selected {
    outline: 2px solid #fff;
}


.hierarchy-content {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    background: var(--background);
    border-radius: 8px;
    font-size: 12px;
    border: 1px solid var(--border);
    position: relative;
}

.hierarchy-item {
    position: relative;
    cursor: pointer;
    margin: 2px 0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.hierarchy-line {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-blue);
}

/* Horizontal connector line */
.hierarchy-connector {
    position: absolute;
    height: 2px;
    background: var(--accent-blue);
    top: 50%;
    z-index: 1;
}

/* Adjust line position based on level */
.hierarchy-item[data-level="1"]::before,
.hierarchy-item[data-level="1"]::after {
    left: 30px;
}

.hierarchy-item[data-level="2"]::before,
.hierarchy-item[data-level="2"]::after {
    left: 50px;
}

/* Stop vertical line at the last child */
.hierarchy-item.last-child::before {
    height: 20px; /* No vertical line for last child */
}
    
.hierarchy-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    min-height: 32px;
    border-radius: 4px;
    background: var(--background-light);
    position: relative;
    z-index: 2; /* Ensure content is above lines */
}

    
.hierarchy-item:hover .hierarchy-item-content {
    background: var(--background-hover);
}

.hierarchy-item.drag-over {
    background-color: rgba(0, 123, 255, 0.1);
    border: 1px dashed #007bff;
}
.hierarchy-rename-input {
  font: inherit;
  padding: 2px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.hierarchy-type-header {
  font-weight: bold;
  padding: 4px 10px;
  background: #eee;
  margin-top: 5px;
}

    
.hierarchy-item.selected {
    background-color: rgba(76, 175, 80, 0.2); /* Light green background */
    font-weight: bold;
}
    
.hierarchy-item.selected .hierarchy-item-content {
    border-left: 2px solid #4caf50; /* Green left border */
}

.hierarchy-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    font-size: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    color: var(--text-secondary);
}

.hierarchy-toggle:hover {
    background-color: rgba(255, 255, 255, 0.15);
}



.hierarchy-context-menu {
    position: fixed;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 0;
    min-width: 120px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.context-menu-item {
    padding: 6px 10px;
    background-color: var(--background-dark);
    cursor: pointer;
    font-size: 12px;
}

.context-menu-item:hover {
    background: var(--accent-blue-light);
}
    
.drop-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--accent-blue);
    z-index: 10;
}

.hierarchy-search {
    display: flex;
    width: 100%;
    margin: 8px auto;
    padding: 0 8px;
}

.hierarchy-search input {
    flex: 1;
    background: var(--accent-blue-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
    outline: none;
    color: var(--text-primary);
}

.hierarchy-search button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
}

.search-match {
    background-color: rgba(255, 255, 150, 0.1);
}

.hierarchy-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
    
.hierarchy-name {
    flex-grow: 1;
    font-size: 12px;
    font-family: monospace;
    white-space: pre;
}
    
    
.hierarchy-visibility {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}
    
.hierarchy-visibility:hover {
    opacity: 1;
}
    
.hierarchy-properties {
    display: flex;
    gap: 4px;
    max-width: 100px;
    overflow-x: auto;
    font-size: 8px;
    background-color: #3869a1b5;
    color: var(--text-secondary);
}
    
.property {
    padding: 2px 6px;
    background: var(--background-dark);
    border-radius: 4px;
    white-space: nowrap;
}
    
/* Drag and drop styles */
.hierarchy-item.dragging {
    opacity: 0.5;
}
    
.hierarchy-item.drop-target > .hierarchy-item-content {
    background: var(--accent-blue-light);
    outline: 2px dashed var(--accent-blue);
}
    
/* Animation classes */
.hierarchy-item {
    animation: slideIn 0.2s ease;
}
    
@keyframes slideIn {
    from {
       opacity: 0;
       transform: translateX(-10px);
    }
    to {
       opacity: 1;
       transform: translateX(0);
    }
}


