/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow: hidden;
    height: 100vh;
    direction: ltr;
    text-align: left;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Menu Bar Styles */
.menu-bar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0;
    display: flex;
    align-items: center;
    height: 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    justify-content: space-between;
}

.menu-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.menu-label {
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    transition: background-color 0.2s ease;
    user-select: none;
}

.menu-label:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 2001;
}

.menu-item:hover .menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-option {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s ease;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
}

.menu-option:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.menu-option:first-child {
    border-radius: 4px 4px 0 0;
}

.menu-option:last-child {
    border-radius: 0 0 4px 4px;
}

.menu-option .menu-text {
    flex: 1;
}

.menu-option .shortcut {
    color: #999;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

.menu-separator {
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 4px 0;
}

.menu-item-right {
    margin-left: auto;
}

.hierarchy-button {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    padding: 4px 12px;
    margin: 0 8px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.hierarchy-button:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    color: #5568d3;
}

.hierarchy-button:active {
    background: rgba(102, 126, 234, 0.3);
    transform: scale(0.98);
}

/* Submenu Styles */
.menu-option.has-submenu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.submenu-arrow {
    font-size: 10px;
    color: #666;
    transition: transform 0.2s ease;
}

.menu-option.has-submenu:hover .submenu-arrow {
    transform: rotate(90deg);
}

.submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    z-index: 2002;
}

.menu-option.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.submenu .menu-option {
    padding: 8px 16px;
    border-radius: 0;
    white-space: nowrap;
}

.submenu .menu-option:first-child {
    border-radius: 4px 4px 0 0;
}

.submenu .menu-option:last-child {
    border-radius: 0 0 4px 4px;
}

/* Preferences Window Styles */
.preferences-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-height: 80vh;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
}

.preferences-window.show {
    opacity: 1;
    visibility: visible;
}

.preferences-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preferences-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

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

.preferences-content {
    padding: 20px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.preferences-section {
    margin-bottom: 24px;
}

.preferences-section:last-child {
    margin-bottom: 0;
}

.preferences-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.preferences-section .control-group {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preferences-section .control-group.control-group-vertical {
    flex-direction: column;
    align-items: flex-start;
}

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

.preferences-section label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
    min-width: 120px;
}

.preferences-section input[type="range"] {
    flex: 1;
    margin: 0 12px;
}

.preferences-section span {
    font-size: 12px;
    color: #666;
    min-width: 30px;
    text-align: right;
}

.preferences-section .btn {
    width: 100%;
    justify-content: center;
}

/* Overlay for preferences window */
.preferences-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.preferences-overlay.show {
    opacity: 1;
    visibility: visible;
}


/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    background: #3498db;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Toggle Button */
.toggle-btn {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 15px;
    background: #bdc3c7;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn.active {
    background: #27ae60;
}

.toggle-btn::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    transition: all 0.3s ease;
    left: 3px;
}

.toggle-btn.active::after {
    left: 23px;
}

/* Statistics Toggle Button */
.btn-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-width: 140px;
}

.btn-toggle:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-toggle.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.btn-toggle .toggle-text {
    margin-left: 8px;
}

.btn-toggle.active .toggle-text::after {
    content: " (ON)";
    font-weight: bold;
}

.btn-toggle:not(.active) .toggle-text::after {
    content: " (OFF)";
    opacity: 0.7;
}

/* Input Styles */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    position: relative;
    background: #2c3e50;
}

#renderCanvas {
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
    cursor: grab;
    touch-action: none;
    user-select: none;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: white;
    font-size: 1.1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */

/* Icon Styles */
.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 250px;
    }
    
    
}

/* Range Value Display */
.control-group span {
    display: inline-block;
    margin-left: 0.5rem;
    color: #3498db;
    font-weight: 600;
    min-width: 30px;
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.5);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.7);
}

/* Compass Styles */
.compass {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
    z-index: 1000;
    pointer-events: none;
}

.compass-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 30px;
    background: #ff4444;
    transform-origin: center bottom;
    transform: translate(-50%, -100%) rotate(0deg);
    border-radius: 1px;
    box-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

.compass-needle::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -3px;
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

.compass-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.compass-label {
    position: absolute;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.compass-north {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-east {
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.compass-south {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-west {
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
}

/* Drawing Tools Panel Styles */
.drawing-panel {
    position: fixed;
    top: 40px;
    left: 20px;
    width: 60px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.panel-header {
    margin-bottom: 8px;
    text-align: center;
    padding: 0 2px;
}

.panel-header h3 {
    color: white;
    font-size: clamp(11px, 0.6vw, 6px);
    font-weight: 400;
    margin: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    .drawing-panel {
        width: 70px;
    }
    
    .panel-header h3 {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .drawing-panel {
        width: 100px;
    }
    
    .panel-header h3 {
        font-size: 8px;
    }
}

.drawing-tools {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.drawing-tools .tool-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    /* Force update - square buttons */
}

.drawing-tools .tool-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    /* Square buttons with smaller size */
}

.drawing-tools .tool-item .tool-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) saturate(100%) invert(100%);
}

/* Tree Tool Styles - removed tool-label styles since tree button doesn't have text */

/* Tree Submenu Styles */
.tree-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 8px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px;
    min-width: 60px;
    z-index: 1001;
}

.tree-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.tree-option:last-child {
    margin-bottom: 0;
}

.tree-option:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.tree-option.active {
    background: rgba(155, 89, 182, 0.3);
    border-color: rgba(155, 89, 182, 0.6);
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.3);
}

.tree-option .tree-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) saturate(100%) invert(100%);
}

.tree-option.active .tree-icon {
    filter: brightness(0) saturate(100%) invert(50%) sepia(100%) saturate(2000%) hue-rotate(280deg) brightness(100%) contrast(100%);
}

/* Tree Height Controls */
.tree-height-controls {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.height-control-group {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 6px;
}

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

.height-control-group label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    min-width: 25px;
    text-align: left;
}

.height-control-group input[type="number"] {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
    padding: 0 4px;
    text-align: center;
}

.height-control-group input[type="number"]:focus {
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.15);
}

.height-control-group input[type="number"]::-webkit-outer-spin-button,
.height-control-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.height-control-group input[type="number"] {
    -moz-appearance: textfield;
}

/* Transform Tools Panel Styles */
.transform-panel {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.transform-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.transform-panel .tool-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
    min-width: 40px;
    min-height: 40px;
    position: relative;
}

.transform-panel .tool-item:hover {
    background: rgba(60, 60, 60, 0.6);
}

.transform-panel .tool-item.active {
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.5);
}

.transform-panel .tool-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #3498db;
    border-radius: 1px;
}

.transform-panel .tool-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) saturate(100%) invert(60%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
    transition: filter 0.2s;
}

.transform-panel .tool-item.active .tool-icon {
    filter: brightness(0) saturate(100%) invert(50%) sepia(100%) saturate(2000%) hue-rotate(200deg) brightness(100%) contrast(100%);
}

/* Coordinate Toggle Button Styles */
#coordinateToggle {
    border-left: 2px solid rgba(255, 255, 255, 0.2);
    margin-left: 12px;
    padding-left: 16px;
    position: relative;
}

#coordinateToggle::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: rgba(255, 255, 255, 0.1);
}

#coordinateToggle.global-mode {
    background: rgba(231, 76, 60, 0.3);
    border: 1px solid rgba(231, 76, 60, 0.6);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

#coordinateToggle.global-mode .tool-icon {
    filter: brightness(0) saturate(100%) invert(30%) sepia(100%) saturate(2000%) hue-rotate(0deg) brightness(100%) contrast(100%);
}

#coordinateToggle.local-mode {
    background: rgba(46, 204, 113, 0.3);
    border: 1px solid rgba(46, 204, 113, 0.6);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

#coordinateToggle.local-mode .tool-icon {
    filter: brightness(0) saturate(100%) invert(50%) sepia(100%) saturate(2000%) hue-rotate(100deg) brightness(100%) contrast(100%);
}

#coordinateToggle:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Properties Popup Styles */
.properties-popup {
    position: fixed;
    top: 28px; /* Below menu bar, same as object list */
    right: 250px; /* Left of object list panel (which is 250px wide) */
    width: 380px; /* Increased width to better display values */
    height: calc(100vh - 28px); /* Full height to bottom of screen */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1500;
    display: none;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.properties-popup.show {
    display: block;
}

/* Circle, Polygon, Tree, and STL Properties Popup - same positioning as main popup */
#circlePropertiesPopup,
#polygonPropertiesPopup,
#treePropertiesPopup,
#stlPropertiesPopup {
    position: fixed;
    top: 28px; /* Below menu bar, same as object list */
    right: 250px; /* Left of object list panel (which is 250px wide) */
    width: 380px; /* Increased width to better display values */
    height: calc(100vh - 28px); /* Full height to bottom of screen */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1500;
    display: none;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#circlePropertiesPopup.show,
#polygonPropertiesPopup.show,
#treePropertiesPopup.show,
#stlPropertiesPopup.show {
    display: block;
}

.properties-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.properties-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: white;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.properties-content {
    padding: 20px;
}

.property-group {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.property-group label {
    min-width: 140px; /* Increased to accommodate longer labels */
    font-weight: 500;
    color: #555;
    font-size: 14px;
    flex-shrink: 0; /* Prevent label from shrinking */
}

.property-group input,
.property-group select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.property-group input:focus,
.property-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.property-group input[type="color"] {
    width: 50px;
    height: 40px;
    padding: 4px;
    cursor: pointer;
}

.property-group input[type="number"] {
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

.property-group input[type="number"]::-webkit-outer-spin-button,
.property-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button;
    opacity: 1;
    height: 20px;
    width: 20px;
    cursor: pointer;
}

/* Remove spinner arrows for readonly number inputs */
.property-group input[type="number"][readonly] {
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

.property-group input[type="number"][readonly]::-webkit-outer-spin-button,
.property-group input[type="number"][readonly]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.property-group input[readonly] {
    background-color: #f8f9fa;
    color: #666;
    cursor: default;
    padding-right: 12px; /* Ensure consistent padding without spinner */
}

.property-group .error-message {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 8px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.properties-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

/* Popup Overlay */
.properties-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2999;
    display: none;
}

.properties-overlay.show {
    display: block;
}

/* Object List Panel Styles */
.object-list-panel {
    position: fixed;
    top: 28px; /* Below menu bar */
    right: 0;
    width: 250px;
    height: calc(100vh - 28px); /* Full height to bottom of screen */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.object-list-panel.hidden {
    display: none;
}

.object-list-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.object-list-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg);
}

.object-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.object-list-container::-webkit-scrollbar {
    width: 6px;
}

.object-list-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.object-list-container::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.5);
    border-radius: 3px;
}

.object-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.7);
}

/* Category Styles */
.object-category {
    margin-bottom: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.category-header {
    background: #f8f9fa;
    padding: 10px 12px;
    cursor: default;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.category-header:hover {
    background: #e9ecef;
}

.category-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.category-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-select {
    cursor: pointer;
    padding: 2px 6px;
    background: #007acc;
    color: white;
    border-radius: 3px;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.category-select:hover {
    background: #005a9e;
}

.category-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.category-count {
    color: #666;
    font-size: 12px;
    margin-left: 8px;
}

.category-toggle {
    color: #666;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.category-content {
    max-height: 300px;
    overflow-y: auto;
}

/* Object Item Styles */
.object-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    background: white;
}

.object-item:last-child {
    border-bottom: none;
}

.object-item:hover {
    background: #f8f9fa;
    transform: translateX(2px);
}

.object-item.selected {
    background: rgba(52, 152, 219, 0.1);
    border-left: 3px solid #3498db;
}

.object-icon {
    font-size: 16px;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.object-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.object-name {
    font-weight: 500;
    color: #333;
    font-size: 13px;
    line-height: 1.2;
}

.object-type {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Empty State */
.object-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.object-list-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.object-list-empty h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.object-list-empty p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .object-list-panel {
        width: 200px;
        height: calc(60vh);
    }
    
    .properties-popup,
    #circlePropertiesPopup,
    #polygonPropertiesPopup,
    #treePropertiesPopup,
    #stlPropertiesPopup {
        right: 200px; /* Left of object list panel (which is 200px wide on tablet) */
        width: 300px; /* Increased width for better value display */
    }
    
    .property-group label {
        min-width: 120px; /* Slightly reduced for tablet */
    }
    
    .object-list-header {
        padding: 10px 12px;
    }
    
    .object-list-header h3 {
        font-size: 14px;
    }
    
    .object-item {
        padding: 6px 10px;
    }
    
    .object-name {
        font-size: 12px;
    }
    
    .object-type {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .object-list-panel {
        width: 100px;
        height: calc(100vh - 28px); /* Full height to bottom of screen */
    }
    
    .properties-popup,
    #circlePropertiesPopup,
    #polygonPropertiesPopup,
    #treePropertiesPopup,
    #stlPropertiesPopup {
        right: 100px; /* Left of object list panel (which is 100px wide on mobile) */
        width: 250px; /* Increased width for better value display on mobile */
        height: calc(100vh - 28px); /* Full height to bottom of screen */
    }
    
    .property-group label {
        min-width: 100px; /* Reduced for mobile */
        font-size: 12px;
    }
    
    .property-group input,
    .property-group select {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .object-list-header {
        padding: 8px 10px;
    }
    
    .object-list-header h3 {
        font-size: 12px;
    }
    
    .object-item {
        padding: 4px 8px;
    }
    
    .object-icon {
        font-size: 14px;
        margin-right: 8px;
    }
}

/* Properties Panel Styles */
.properties-panel {
    position: fixed;
    top: calc(28px + 66.67vh + 10px); /* Below object list panel */
    right: 0;
    width: 300px;
    height: calc(100vh - 28px - 66.67vh - 20px); /* Remaining height */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1500;
    display: none;
    overflow-y: auto;
}

.properties-panel.show {
    display: block;
}

.properties-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1;
    flex-shrink: 0;
}

.properties-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.properties-content {
    padding: 16px;
}

.properties-empty {
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

.properties-empty p {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 500;
}

.properties-empty small {
    font-size: 14px;
    color: #999;
}

.property-section {
    margin-bottom: 20px;
}

.property-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

.property-group {
    margin-bottom: 12px;
}

.property-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.property-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.property-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.property-group input[readonly] {
    background-color: #f8f9fa;
    color: #666;
    cursor: not-allowed;
}

.property-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.property-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.property-group input[type="color"] {
    width: 100%;
    height: 40px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.property-group input[type="color"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.property-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #ccc;
}

/* Responsive Design for Properties Panel */
@media (max-width: 768px) {
    .properties-panel {
        width: 200px;
        height: calc(100vh - 28px - 60vh - 20px);
    }
    
    .properties-header {
        padding: 10px 12px;
    }
    
    .properties-header h3 {
        font-size: 14px;
    }
    
    .properties-content {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .properties-panel {
        width: 200px;
        height: calc(100vh - 28px - 50vh - 20px);
    }
    
    .properties-header {
        padding: 8px 10px;
    }
    
    .properties-header h3 {
        font-size: 12px;
    }
    
    .properties-content {
        padding: 10px;
    }
}


/* Responsive Design */
@media (max-width: 768px) {
    .drawing-panel {
        width: 40px;
        padding: 4px;
    }
    
    .drawing-tools .tool-item {
        width: 28px;
        height: 28px;
    }
    
    .drawing-tools .tool-item .tool-icon {
        width: 14px;
        height: 14px;
    }
    
    .panel-header h3 {
        font-size: 10px;
    }
    
    .properties-popup {
        min-width: 250px;
        margin: 20px;
    }
}

/* ===== MODAL DIALOG STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #f0f0f0;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* ===== DRAWING TOOLS ACTIVE STATES - FINAL OVERRIDE ===== */
/* Rectangle tool active state - Blue */
#drawingPanel .drawing-tools .tool-item[data-tool="rectangle"].active {
    background: rgba(52, 152, 219, 0.3) !important;
    border-color: rgba(52, 152, 219, 0.6) !important;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3) !important;
}

/* Circle tool active state - Green */
#drawingPanel .drawing-tools .tool-item[data-tool="circle"].active {
    background: rgba(46, 204, 113, 0.3) !important;
    border-color: rgba(46, 204, 113, 0.6) !important;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3) !important;
}

/* Polygon tool active state - Orange */
#drawingPanel .drawing-tools .tool-item[data-tool="polygon"].active {
    background: rgba(230, 126, 34, 0.3) !important;
    border-color: rgba(230, 126, 34, 0.6) !important;
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.3) !important;
}

/* Tree tool active state - Purple */
#drawingPanel .drawing-tools .tool-item[data-tool="tree"].active {
    background: rgba(155, 89, 182, 0.3) !important;
    border-color: rgba(155, 89, 182, 0.6) !important;
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.3) !important;
}

/* Rectangle tool icon active state - Blue */
#drawingPanel .drawing-tools .tool-item[data-tool="rectangle"].active .tool-icon {
    filter: brightness(0) saturate(100%) invert(50%) sepia(100%) saturate(2000%) hue-rotate(200deg) brightness(100%) contrast(100%) !important;
}

/* Circle tool icon active state - Green */
#drawingPanel .drawing-tools .tool-item[data-tool="circle"].active .tool-icon {
    filter: brightness(0) saturate(100%) invert(50%) sepia(100%) saturate(2000%) hue-rotate(100deg) brightness(100%) contrast(100%) !important;
}

/* Polygon tool icon active state - Orange */
#drawingPanel .drawing-tools .tool-item[data-tool="polygon"].active .tool-icon {
    filter: brightness(0) saturate(100%) invert(50%) sepia(100%) saturate(2000%) hue-rotate(30deg) brightness(100%) contrast(100%) !important;
}

/* Tree tool icon active state - Purple */
#drawingPanel .drawing-tools .tool-item[data-tool="tree"].active .tool-icon {
    filter: brightness(0) saturate(100%) invert(50%) sepia(100%) saturate(2000%) hue-rotate(280deg) brightness(100%) contrast(100%) !important;
}

/* Transform Input Panel (Bottom of Screen) */
.transform-input-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    padding: 12px 20px;
    z-index: 1400;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 300px;
    border-radius: 8px 8px 0 0;
}

.transform-input-container {
    display: flex;
    gap: 20px;
    align-items: center;
}

.transform-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.transform-input-group label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    min-width: 20px;
}

.transform-input {
    width: 100px;
    padding: 6px 10px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.transform-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.transform-input:hover {
    border-color: rgba(0, 0, 0, 0.3);
}

/* Surface Types Manager Styles */
.surface-types-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.surface-types-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.tab-button {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
    position: relative;
}

.tab-button:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.surface-types-content {
    flex: 1;
    overflow: hidden;
    padding: 20px;
}

.tab-content {
    display: none;
    height: 100%;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.surface-types-table-container {
    width: 100%;
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.surface-types-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.surface-types-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.surface-types-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.surface-types-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

.surface-types-table tbody tr:hover {
    background: #f8f9fa;
}

.surface-types-table tbody tr:last-child td {
    border-bottom: none;
}

.surface-type-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.surface-type-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.surface-type-input:hover {
    border-color: #bbb;
}

.add-row-btn {
    width: auto;
    margin-top: 10px;
    padding: 6px 12px;
    font-size: 13px;
}

.delete-row-btn {
    padding: 4px 8px;
    font-size: 12px;
    min-width: 60px;
}

.delete-row-btn:hover {
    background: #dc3545;
    color: white;
}

/* Smaller buttons for Surface Types Manager dialog */
#surfaceTypesManagerDialog .modal-footer {
    justify-content: flex-start !important;
}

#surfaceTypesManagerDialog .modal-footer .btn {
    padding: 8px 20px !important;
    font-size: 13px !important;
    width: auto !important;
    min-width: 70px !important;
    max-width: 100px !important;
    margin: 0 5px;
}

#surfaceTypesManagerDialog .modal-footer .btn:disabled,
#surfaceTypesManagerDialog .modal-footer .btn.btn-disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
}