/* Shape Editor Styles */
.mesh-viewer-container {
    position: relative;
}

.model-viewer-wrapper {
    position: relative;
    overflow: hidden;
}

.code-editor-container {
    position: relative;
}

/* Tip Label Styles */
.tip-label {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    background: #6c757d;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 0 0 0 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: help;
    user-select: none;
    transition: background-color 0.2s ease;
}

.tip-label:hover {
    background: #5a6268;
}

/* Gallery Label Styles */
.gallery-label {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    background: #28a745;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 0 0 4px 0;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.gallery-label:hover {
    background: #218838;
}

/* Tooltip styles - Updated to show below */
.tip-label::after,
.gallery-label::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 280px;
    white-space: normal;
    word-wrap: break-word;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(5px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tip-label::before,
.gallery-label::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 2px;
    border: 4px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.tip-label:hover::after,
.tip-label:hover::before,
.gallery-label:hover::after,
.gallery-label:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Gallery Dropdown Styles */
.gallery-dropdown {
    position: absolute;
    top: 25px;
    left: 0;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.gallery-dropdown-content {
    padding: 4px 0;
}

.gallery-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f1f1;
}

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

.gallery-item:hover {
    background-color: #f8f9fa;
}

.gallery-item.selected {
    background-color: #e7f3ff;
    color: #0066cc;
    font-weight: 500;
}

.gallery-item-name {
    font-size: 13px;
    color: #333;
}

.gallery-item:hover .gallery-item-name {
    color: #0066cc;
}


.code-editor-wrapper {
    border: 1px solid #ddd;
    border-radius: 8px;
    /* overflow: hidden; */
    background: #ffffff;
}

/* Editor toolbar styles removed as execute/reset buttons are no longer needed */

.code-editor {
    background: #ffffff;
    height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace;
    font-size: 13px;
    line-height: 1.5;
    border: none;
    outline: none;
    padding: 15px;
}

/* Comment blocks */
.code-comment-block {
    margin-bottom: 15px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-left: 3px solid #6a737d;
    border-radius: 4px;
}

.code-comment-block .code-line {
    color: #6a737d;
    font-style: italic;
    margin: 2px 0;
}

/* Function blocks */
.code-function-block {
    position: relative;
    margin-bottom: 15px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.2s ease;
    overflow: hidden;
}

.code-function-block:hover {
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

.code-function-block.function-highlighted {
    border-color: #ffc107;
    background-color: rgba(255, 243, 205, 0.2);
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
    animation: functionBlockHighlight 0.3s ease;
}

@keyframes functionBlockHighlight {
    0% {
        transform: scale(1.02);
        background-color: rgba(255, 243, 205, 0.4);
    }
    100% {
        transform: scale(1);
        background-color: rgba(255, 243, 205, 0.2);
    }
}

/* Function headers */
.function-header {
    background: #f6f8fa;
    padding: 8px 12px;
    border-bottom: 1px solid #e1e4e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.function-name {
    font-weight: bold;
    color: #24292e;
}

.function-type {
    background: #0366d6;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    text-transform: uppercase;
}

.function-type.primitive {
    background: #28a745;
}

.function-type.curve {
    background: #6f42c1;
}

.function-type.circle {
    background: #fd7e14;
}

/* Function code areas */
.function-code-area {
    position: relative;
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    padding: 12px;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: transparent;
    caret-color: #333;
    resize: vertical;
    z-index: 2;
    overflow-y: auto;
}

/* Function syntax overlays */
.function-syntax-overlay {
    position: absolute;
    top: 41px; /* Account for header height */
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px;
    pointer-events: none;
    font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace;
    font-size: 13px;
    line-height: 1.5;
    z-index: 1;
    overflow: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Enhanced editor syntax highlighting */
.editor-function {
    color: #d73a49;
    font-weight: bold;
}

.editor-variable {
    color: #6f42c1;
}

.editor-string {
    color: #032f62;
}

.editor-number {
    color: #005cc5;
}

.editor-comment {
    color: #6a737d;
    font-style: italic;
}

/* Code execution feedback styles removed as execute functionality is no longer needed */

/* Viewer controls */
.viewer-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.viewer-controls .button {
    font-size: 12px;
}

.viewer-controls .button.is-active {
    background-color: #363636;
    color: #ffffff;
    border-color: #363636;
}

.viewer-controls .button.is-active:hover {
    background-color: #292929;
    border-color: #292929;
}

/* Mesh interaction feedback */
.mesh-viewer-container::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mesh-viewer-container.mesh-active::after {
    opacity: 1;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Notification styles for the tips section */
.notification.is-info.is-light {
    background-color: #e7f3ff;
    border-left: 4px solid #4a90e2;
}

.notification.is-info.is-light code {
    background-color: #ffffff;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
    border: 1px solid #ddd;
}

/* Gallery Styles */
.gallery-image-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-image-item.selected {
    border: 3px solid #4a90e2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.gallery-image-item img {
    transition: transform 0.2s ease;
}

.gallery-image-item:hover img {
    transform: scale(1.05);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-item.selected {
    border: 3px solid #4a90e2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.gallery-item img {
    transition: transform 0.2s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-mesh-viewer-container,
.gallery-code-editor-container {
    position: relative;
}

.gallery-mesh-tip,
.gallery-code-tip {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    background: #6c757d;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 0 0 0 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: help;
    user-select: none;
    transition: background-color 0.2s ease;
}

.gallery-mesh-tip:hover,
.gallery-code-tip:hover {
    background: #5a6268;
}

/* Gallery Code Function Blocks */
.gallery-code-function-block {
    position: relative;
    margin-bottom: 15px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.2s ease;
    overflow: hidden;
}

.gallery-code-function-block:hover {
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

.gallery-code-function-block.function-highlighted {
    border-color: #ffc107;
    background-color: rgba(255, 243, 205, 0.2);
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
    animation: functionBlockHighlight 0.3s ease;
}

.function-code-display {
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #f8f9fa;
    border-top: 1px solid #e1e4e8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Shape Understanding vertical alignment */
.columns[style*="align-items: stretch"] .column {
    display: flex;
    flex-direction: column;
}

.columns[style*="align-items: stretch"] .column > div {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.understanding-code-container,
.llm-processing-container,
.understanding-qa-container {
    min-height: 450px;
}

.llm-processing-indicator {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .gallery-item img,
    .gallery-image-item img {
        height: 100px;
    }
    
    .understanding-code-container,
    .llm-processing-container,
    .understanding-qa-container {
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .code-editor {
        height: 450px;
        min-height: 450px;
    }
    
    .function-code-area,
    .function-syntax-overlay {
        font-size: 12px;
    }
    
    .model-viewer-wrapper model-viewer {
        height: 300px;
    }
    
    .viewer-controls .button {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .function-header {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .gallery-item img,
    .gallery-image-item img {
        height: 80px;
    }
    
    /* Stack shape understanding vertically on mobile */
    .columns[style*="align-items: stretch"] {
        flex-direction: column;
    }
    
    .columns[style*="align-items: stretch"] .column {
        flex: none !important;
        width: 100%;
    }
    
    .understanding-code-container,
    .llm-processing-container,
    .understanding-qa-container {
        min-height: 200px;
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .gallery-item img,
    .gallery-image-item img {
        height: 60px;
    }
    
    /* Stack gallery images on very small screens */
    .gallery-container .columns {
        flex-wrap: wrap;
    }
    
    .gallery-container .column {
        flex: 0 0 50%;
        max-width: 50%;
    }
} 