@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400&family=Work+Sans:wght@100;200;300;400&display=swap');

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

body {
    font-family: 'Inter', 'Work Sans', 'Helvetica Neue', Helvetica, Arial, 'Akzidenz-Grotesk', 'Univers', system-ui, -apple-system, sans-serif;
    font-weight: 300;
    font-size: 15px;
    background-color: #0a0a09;
    overflow: hidden;
    color: #ccc;
}

.container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#app-title {
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 72px;
    font-weight: 200;
    color: #ddd;
    letter-spacing: -0.01em;
    z-index: 1000;
    pointer-events: none;
    user-select: none;
}

#app-subtitle {
    position: fixed;
    top: 33px;
    left: 350px;
    font-size: 31px;
    font-weight: 200;
    color: #ddd;
    letter-spacing: 0.03em;
    line-height: 1.0;
    z-index: 1000;
    pointer-events: none;
    user-select: none;
}

.controls {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    max-height: calc(100vh - 40px);
    background: rgba(0, 0, 0, 0.65);
    border: 1.5px solid #eee;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(255,255,255,0.15);
    backdrop-filter: blur(20px) saturate(1.2);
    overflow-y: auto;
    z-index: 1002;
    transition: all 0.2s ease;
    font-family: 'Inter', 'Work Sans', 'Helvetica Neue', Helvetica, Arial, 'Akzidenz-Grotesk', 'Univers', system-ui, -apple-system, sans-serif;
    font-weight: 300;
    color: #eee;
    padding: 28px 24px 24px 24px;
}

.controls:hover {
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.25);
    border-color: #ccc;
}

#scene-container {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0f0f0f 0%, #1f1f1f 100%);
    position: relative;
}

h1 {
    font-size: 36px;
    margin-bottom: 24px;
    color: #ddd;
    font-weight: 200;
    border-bottom: 1.5px solid #ddd;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.02em;
}

h1 i {
    color: #aaa;
}

h2 {
    font-size: 28px;
    margin: 4px 0 14px;
    color: #bbb;
    font-weight: 250;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

/* Hide icons in the controls panel sections */
.controls h2 i {
    display: none;
}

h3 {
    font-size: 22px;
    margin: 14px 0;
    color: #aaa;
    font-weight: 200;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.01em;
}

/* Hide icons in the controls panel subsections */
.controls h3 i {
    display: none;
}

.control-group {
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0 0 24px 0;
    margin-top: 0;
    margin-bottom: 24px;
    padding-left: 0;
    padding-right: 0;
    position: relative;
}

.control-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -24px;
    right: -24px;
    height: 1.5px;
    background: #ddd;
}

/* Remove extra margin on first and last .control-group to avoid overflow */
.controls > .control-group:first-child {
    margin-top: 0;
}
.controls > .control-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.controls > .control-group:last-child::after {
    display: none;
}

.control {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
}

label {
    display: inline-block;
    width: 70px;
    margin-right: 10px;
    font-weight: 200;
    font-size: 13px;
    letter-spacing: 0.01em;
}

input[type="range"], input[type="color"], input[type="text"], input[type="number"] {
    border-radius: 14px;
    border: 1.5px solid #ddd;
    background: #070605;
    color: #ddd;
    font-size: 15px;
    font-weight: 300;
    padding: 6px 10px;
    margin: 0 4px;
    transition: border 0.2s, box-shadow 0.2s;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 1px;
    background: #ddd;
    outline: none;
    border-radius: 0px;
    flex-grow: 1;
    margin-right: 0px;
    border: none;
    padding: 0;
}

input[type="range"]::-moz-range-track {
    height: 0px;
    background: #ddd;
    border: none;
    border-radius: 0px;
}

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

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

input[type="range"]::-moz-range-thumb {
    width: 8px;
    height: 8px;
    background: #ddd;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #fff;
    transform: scale(1.2);
}

/* Size slider (yellow to match scale cube) */
#cube-size::-webkit-slider-thumb {
    background: #ffcc00;
}

#cube-size::-webkit-slider-thumb:hover {
    background: #ffdd33;
    transform: scale(1.2);
}

#cube-size::-moz-range-thumb {
    background: #ffcc00;
}

#cube-size::-moz-range-thumb:hover {
    background: #ffdd33;
    transform: scale(1.2);
}

/* X-axis sliders (orange-red) */
#position-x::-webkit-slider-thumb,
#rotation-x::-webkit-slider-thumb {
    background: #ff7800;
}

#position-x::-webkit-slider-thumb:hover,
#rotation-x::-webkit-slider-thumb:hover {
    background: #ff9933;
    transform: scale(1.2);
}

#position-x::-moz-range-thumb,
#rotation-x::-moz-range-thumb {
    background: #ff7800;
}

#position-x::-moz-range-thumb:hover,
#rotation-x::-moz-range-thumb:hover {
    background: #ff9933;
    transform: scale(1.2);
}

/* Y-axis sliders (green) */
#position-y::-webkit-slider-thumb,
#rotation-y::-webkit-slider-thumb {
    background: #00dc96;
}

#position-y::-webkit-slider-thumb:hover,
#rotation-y::-webkit-slider-thumb:hover {
    background: #33e6aa;
    transform: scale(1.2);
}

#position-y::-moz-range-thumb,
#rotation-y::-moz-range-thumb {
    background: #00dc96;
}

#position-y::-moz-range-thumb:hover,
#rotation-y::-moz-range-thumb:hover {
    background: #33e6aa;
    transform: scale(1.2);
}

/* Z-axis sliders (blue) */
#position-z::-webkit-slider-thumb,
#rotation-z::-webkit-slider-thumb {
    background: #00aaff;
}

#position-z::-webkit-slider-thumb:hover,
#rotation-z::-webkit-slider-thumb:hover {
    background: #33bbff;
    transform: scale(1.2);
}

#position-z::-moz-range-thumb,
#rotation-z::-moz-range-thumb {
    background: #00aaff;
}

#position-z::-moz-range-thumb:hover,
#rotation-z::-moz-range-thumb:hover {
    background: #33bbff;
    transform: scale(1.2);
}

input[type="color"] {
    width: 20px;
    height: 20px;
    border-radius: 0;
    box-shadow: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0 4px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    background: none;
    vertical-align: middle;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
    border-radius: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 0;
    padding: 0;
}

input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 0;
}

input[type="text"], input[type="number"] {
    border-radius: 14px;
    border: 1.5px solid #ddd;
    background: #070605;
    color: #ddd;
    font-size: 15px;
    font-weight: 300;
    padding: 6px 10px;
    margin: 0 4px;
}

input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: #eee;
    background: #000;
    box-shadow: 0 0 0 2px rgba(136,136,136,0.08);
}

#object-name-control {
    margin-bottom: 4px;
    padding-bottom: 0px;
}

span {
    width: 45px;
    text-align: right;
    margin-left: 12px;
    font-family: monospace;
    font-size: 14px;
    background: #0f0f0f;
    color: #ddd;
    padding: 2px 6px;
    border-radius: 3px;
}

.value-input {
    border-radius: 10px !important;
    background: #070605 !important;
    border: 1.5px solid #ddd !important;
    color: #ddd !important;
    font-size: 13px !important;
    padding: 4px 8px !important;
    width: 60px !important;
    margin-left: 8px !important;
    margin-right: 4px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
}

button, .toolbar-btn {
    background: linear-gradient(135deg, #888 0%, #999 100%);
    color: #000;
    border: none;
    border-radius: 20px !important;
    box-shadow: 0 2px 8px rgba(255,255,255,0.10);
    font-size: 17px;
    font-weight: 300;
    padding: 12px 20px;
    margin: 8px 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

button:hover, .toolbar-btn:hover {
    background: linear-gradient(135deg, #999 0%, #aaa 100%);
    box-shadow: 0 4px 12px rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

button:active, .toolbar-btn:active {
    background: #aaa;
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(255,255,255,0.10);
}

button:disabled, .toolbar-btn:disabled {
    background: #444;
    color: #111;
    cursor: not-allowed;
    box-shadow: 0 2px 8px rgba(255,255,255,0.10);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

#group-button {
    background-color: #888;
    margin-bottom: 0;
}

#group-button:hover {
    background-color: #999;
}

#ungroup-button {
    background-color: #888;
    margin-bottom: 0;
}

#ungroup-button:hover {
    background-color: #999;
}

.hidden {
    display: none;
}

#no-selection {
    font-style: italic;
    color: #666;
    text-align: left;
    padding: 10px;
}

/* Old AI prompt styles removed - now handled by floating chatbox styles */

#export-scene {
    background-color: #888;
    width: 100%;
}

#export-scene:hover {
    background-color: #999;
}

/* File management icon styling */
#file-icon {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: #070605;
    color: #ccc;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255,255,255,0.10);
    z-index: 100;
    transition: all 0.2s;
}

#file-icon:hover {
    background: #1f1f1f;
    color: #eee;
    border-color: #ccc;
}

#file-icon:active {
    transform: translateY(1px);
    box-shadow: 0 1px 6px rgba(255, 255, 255, 0.2);
}

#file-icon i {
    font-size: 18px;
}

/* Registry styling */
.registry-list {
    background: none;
    border-radius: 0;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.empty-registry {
    color: #666;
    font-style: italic;
    text-align: left;
    padding: 10px;
    font-size: 14px;
}

.registry-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-radius: 0;
    margin-bottom: 4px;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.registry-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.registry-item.selected {
    background: rgba(255, 255, 255, 0.1);
}

.registry-item-name {
    font-weight: 200;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.registry-item-type {
    color: #777;
    font-size: 11px;
}

/* Group dropdown styles */
.registry-group {
    margin-bottom: 4px;
}

.registry-group-header {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-radius: 0;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.registry-group-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.registry-group-header.selected {
    background: rgba(255, 255, 255, 0.1);
}

.registry-group-toggle {
    width: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    color: #ccc;
    font-size: 12px;
    transition: all 0.2s;
    cursor: pointer;
    border-radius: 2px;
    min-height: 16px;
}

.registry-group-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.registry-group-toggle i {
    pointer-events: none;
}

.registry-item-content {
    display: flex;
    justify-content: space-between;
    flex: 1;
}

.registry-group-children {
    margin-left: 20px;
    border-left: 1.5px solid #bbb;
    padding-left: 8px;
    transition: all 0.3s ease;
}

.registry-group-children.hidden {
    display: none;
}

.registry-child-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-radius: 0;
    margin-bottom: 2px;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
    font-size: 12px;
}

.registry-child-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.registry-child-item.selected {
    background: rgba(255, 255, 255, 0.08);
}

.registry-child-item .registry-item-name {
    font-size: 12px;
    color: #bbb;
}

.registry-child-item .registry-item-type {
    font-size: 10px;
    color: #666;
}

/* Settings section styling */
.settings-section {
    background: rgba(7, 7, 7, 0.7);
    border-radius: 14px;
    padding: 10px 12px;
    border: 1.5px solid #ddd;
    box-shadow: 0 2px 8px rgba(255,255,255,0.08);
    backdrop-filter: blur(12px) saturate(1.1);
    margin-bottom: 16px;
}

.settings-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

::-webkit-scrollbar-track {
    background: #0e0e0e;
}

::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* CAD Toolbar Styles */
#cad-toolbar {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.65);
    border: 1.5px solid #eee;
    border-radius: 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 20px rgba(255,255,255,0.15);
    backdrop-filter: blur(20px) saturate(1.2);
    z-index: 1000;
    user-select: none;
    font-family: 'Inter', 'Work Sans', 'Helvetica Neue', Helvetica, Arial, 'Akzidenz-Grotesk', 'Univers', system-ui, -apple-system, sans-serif;
    font-weight: 300;
}

.toolbar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.toolbar-btn {
    background: transparent !important;
    color: #999 !important;
    border: 1px solid transparent !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1) !important;
    margin: 2px 0;
    width: 36px;
    height: 36px;
    padding: 0 !important;
    font-size: 16px;
    transition: all 0.2s;
    font-weight: normal !important;
    gap: 0 !important;
}

.toolbar-btn:hover {
    background: #0f0f0f !important;
    border-color: #333 !important;
    color: #ccc !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15) !important;
}

.toolbar-btn:active {
    background: #1f1f1f !important;
    transform: translateY(0) !important;
    box-shadow: 0 1px 4px rgba(255, 255, 255, 0.1) !important;
}

.toolbar-btn.active, .toolbar-btn.active:hover {
    background: #ccc !important;
    color: #000 !important;
    border-color: #ccc !important;
    transform: none !important;
}

/* Special styling for pen tool - orange-red border when not active */
.toolbar-btn[data-tool="pen"] {
    border-color: #ff7800 !important;
}

.toolbar-btn[data-tool="pen"]:hover {
    border-color: #ff7800 !important;
    background: rgba(255, 120, 0, 0.1) !important;
}

/* Special styling for pen tool when active */
.toolbar-btn[data-tool="pen"].active, .toolbar-btn[data-tool="pen"].active:hover {
    background: #ff7800 !important;
    color: #fff !important;
    border-color: #ff7800 !important;
    box-shadow: 0 0 10px rgba(255, 120, 0, 0.4) !important;
}

.toolbar-btn i {
    font-size: 16px;
    line-height: 1;
}

.toolbar-separator {
    width: 24px;
    height: 1.5px;
    background: #ccc;
    margin: 4px 0;
}

/* Tooltip enhancement for toolbar buttons */
.toolbar-btn::after {
    content: attr(title);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #ccc;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1001;
    margin-top: 4px;
    pointer-events: none;
}

.toolbar-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    #cad-toolbar {
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
        flex-direction: column;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
    
    .toolbar-btn {
        width: 32px;
        height: 32px;
    }
    
    .toolbar-btn i {
        font-size: 14px;
    }
    
    .controls {
        width: calc(100vw - 40px);
        max-width: 400px;
        top: 10px;
        right: 10px;
        left: 10px;
        max-height: calc(100vh - 20px);
        padding: 16px;
    }
}

/* Floating AI Chatbox - Minimalist Single Row */
#ai-chatbox {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    backdrop-filter: none;
    z-index: 1001;
    font-family: 'Inter', 'Work Sans', 'Helvetica Neue', Helvetica, Arial, 'Akzidenz-Grotesk', 'Univers', system-ui, -apple-system, sans-serif;
    font-weight: 300;
    transition: all 0.2s ease;
    max-width: 600px;
}

#ai-chatbox:hover {
    box-shadow: none;
    border-color: transparent;
}

#ai-chatbox #ai-prompt {
    flex: 1;
    min-width: 300px;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 16px;
    border: 1.5px solid #888;
    border-radius: 22px;
    background: #070605;
    color: #ddd;
    font-family: 'Inter', 'Work Sans', 'Helvetica Neue', Helvetica, Arial, 'Akzidenz-Grotesk', 'Univers', system-ui, -apple-system, sans-serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.4;
    transition: all 0.2s ease;
    margin: 0;
    resize: none;
    overflow-y: hidden;
    box-sizing: border-box;
}

#ai-chatbox #ai-prompt:focus {
    outline: none;
    background: #000;
    box-shadow: 0 0 0 2px rgba(136, 136, 136, 0.1);
}

#ai-chatbox #ai-prompt::placeholder {
    color: #666;
    font-style: italic;
    font-size: 14px;
}

#ai-chatbox #generate-model {
    background: linear-gradient(135deg, #888 0%, #999 100%);
    color: black;
    border: none;
    min-width: 120px;
    height: 40px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0 16px;
    font-size: 17px;
    font-weight: 300;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

#ai-chatbox #generate-model:hover {
    background: linear-gradient(135deg, #999 0%, #aaa 100%);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

#ai-chatbox #generate-model:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(255, 255, 255, 0.1);
}

#ai-chatbox #generate-model:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

#ai-chatbox #generate-model i {
    font-size: 16px;
    color: #000000;
}



/* Mobile responsive for AI chatbox */
@media (max-width: 768px) {
    #ai-chatbox {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        width: auto;
        max-width: none;
    }
    
    #ai-chatbox #ai-prompt {
        min-width: 250px;
        max-height: 100px;
    }
    
    #ai-chatbox #generate-model {
        min-width: 100px;
        font-size: 12px;
        padding: 0 12px;
    }
}

/* Shape Popup Menu Styles - Minimalist Toolbar Style */
.shape-popup {
    position: fixed;
    background: rgba(0, 0, 0, 0.65);
    border: 1.5px solid #eee;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(1.2);
    z-index: 10000;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: all 0.2s ease;
    transform: scale(0.95);
    opacity: 0;
}

.shape-popup:not(.hidden) {
    transform: scale(1);
    opacity: 1;
}

.popup-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 50% !important;
    color: #999 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1) !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.popup-btn:hover {
    background: #0f0f0f !important;
    border-color: #333 !important;
    color: #ccc !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15) !important;
}

.popup-btn:active {
    background: #1f1f1f !important;
    transform: translateY(0) !important;
    box-shadow: 0 1px 4px rgba(255, 255, 255, 0.1) !important;
}

.popup-btn i {
    font-size: 16px !important;
    line-height: 1 !important;
    transition: all 0.2s;
}

/* Tooltip for popup buttons */
.popup-btn::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #ccc;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10001;
    margin-left: 8px;
    pointer-events: none;
}

.popup-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Pen Tool Drawing Canvas */
#pen-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1000;
    background: transparent;
}

#pen-canvas.drawing {
    pointer-events: all;
}

.pen-stroke {
    fill: none;
    stroke: #00dc96;
    stroke-width: 2;
    stroke-opacity: 0.8;
    transition: all 0.3s ease;
}

.pen-stroke.ai-ready {
    stroke: #ff7800;
    stroke-width: 3;
    stroke-dasharray: 8,4;
    stroke-opacity: 0.9;
    filter: drop-shadow(0 0 6px rgba(255, 120, 0, 0.5));
    animation: pulse-ai 2s infinite;
}

.pen-circle {
    fill: rgba(0, 220, 150, 0.1);
    stroke: #00dc96;
    stroke-width: 1.5;
    stroke-dasharray: 5,5;
    stroke-opacity: 0.8;
    transition: all 0.3s ease;
}

.pen-circle.ai-ready {
    fill: rgba(255, 120, 0, 0.15);
    stroke: #ff7800;
    stroke-width: 1.5;
    stroke-opacity: 0.9;
    filter: drop-shadow(0 0 6px rgba(255, 120, 0, 0.3));
    animation: pulse-ai 2s infinite;
}

.viewport-center-indicator {
    fill: rgba(33, 150, 243, 0.3);
    stroke: #2196f3;
    stroke-width: 2;
    stroke-dasharray: 4,4;
    animation: pulse-center 1.5s infinite;
}

@keyframes pulse-center {
    0%, 100% { 
        r: 8;
        stroke-opacity: 0.8;
        fill-opacity: 0.3;
    }
    50% { 
        r: 12;
        stroke-opacity: 1.0;
        fill-opacity: 0.5;
    }
}

@keyframes pulse-ai {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1.0; }
}

.pen-feedback {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.8);
    color: black;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s;
}

.pen-feedback.visible {
    opacity: 1;
    transform: translateY(0);
}

/* AI Notification System */
.ai-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    background: rgba(255, 255, 255, 0.8);
    color: black;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.ai-notification.visible {
    opacity: 1;
    transform: translateX(0);
}

.ai-notification-success {
    background: rgba(179, 80, 175, 0.9);
}

.ai-notification-error {
    background: rgba(11, 188, 201, 0.9);
}

.ai-notification-info {
    background: rgba(222, 105, 12, 0.9);
}

/* AI Status Visualization */
.ai-status-visualization {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    height: 120px;
    margin-bottom: 40px;
    position: relative;
}

.ai-circle-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ai-circle-border {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 1.5px solid #eee;
    border-radius: 50%;
    top: 0;
    left: 0;
    transition: border-color 0.3s ease;
}

.ai-cross {
    position: relative;
    width: 50px;
    height: 50px;
    animation: idle-spin 4s linear infinite;
    z-index: 2;
}

.ai-cross-second {
    animation: idle-spin 4s linear infinite;
}

.cross-line {
    position: absolute;
    background: #ccc;
    border-radius: 1px;
}

.cross-line-1 {
    width: 30px;
    height: 2px;
    top: 50%;
    left: -25px;
    transform: translateY(-50%);
}

.cross-line-2 {
    width: 2px;
    height: 30px;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
}

.cross-line-3 {
    width: 30px;
    height: 2px;
    top: 50%;
    right: -25px;
    transform: translateY(-50%);
}

.cross-line-4 {
    width: 2px;
    height: 30px;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
}

/* Idle state animation */
@keyframes idle-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes idle-spin-reverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

/* Active AI generation state */
.ai-status-visualization.generating .ai-circle-border {
    border-color: #ff7800;
    box-shadow: 0 0 10px rgba(255, 120, 0, 0.3);
}

.ai-status-visualization.generating .ai-cross {
    animation: fast-spin 0.8s linear infinite;
}

.ai-status-visualization.generating .ai-cross-second {
    animation: fast-spin 0.8s linear infinite;
}

.ai-status-visualization.generating .cross-line {
    background: #ff7800;
    box-shadow: 0 0 4px rgba(255, 120, 0, 0.6);
}

@keyframes fast-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes fast-spin-reverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

/* Special styling for inline h3 titles with inputs */
.inline-title-control {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.inline-title-control h3 {
    margin: 0;
    margin-right: 10px;
    width: 70px;
    font-size: 22px;
    color: #aaa;
    font-weight: 200;
    letter-spacing: 0.01em;
    flex-shrink: 0;
}

.inline-title-control .control {
    margin-bottom: 0;
    flex-grow: 1;
    margin-left: -10px;
}

/* Specific styling for name input to align with all inputs */
.inline-title-control .control #object-name {
    width: calc(100% - 10px);
    margin-right: 4px;
}

/* Specific styling for color input to align with title text */
.inline-title-control .control #cube-color {
    margin-top: 0px;
    margin-bottom: 0px;
}

/* Specific styling for size slider to align with title text */
.inline-title-control .control #cube-size {
    margin-top: 0px;
    margin-bottom: 0px;
} 