/* Modal Base Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal {
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 16px;
    padding: 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    animation: modalSlideIn 0.4s ease-out;
}

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

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.modal-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00d4aa, #0078d4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.modal-subtitle {
    font-size: 14px;
    color: #888888;
    margin: 0;
}

/* License Key Modal */
.license-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.license-input-label {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
}

.license-input {
    padding: 12px 16px;
    background: #222222;
    border: 1px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.license-input:focus {
    outline: none;
    border-color: #00d4aa;
}

.license-input::placeholder {
    color: #666666;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background: #00d4aa;
    color: #000000;
}

.modal-btn-primary:hover {
    background: #00c298;
    transform: translateY(-1px);
}

.modal-btn-secondary {
    background: #333333;
    color: #ffffff;
    border: 1px solid #444444;
}

.modal-btn-secondary:hover {
    background: #3a3a3a;
    border-color: #555555;
}

/* Subscription Modal */
.subscription-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.subscription-iframe-container {
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    animation: subscriptionModalSlideIn 0.5s ease-out;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

@keyframes subscriptionModalSlideIn {
    from {
        transform: scale(0.9) translateY(30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.subscription-iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
}

.subscription-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.subscription-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.subscription-header {
    background: linear-gradient(135deg, #00d4aa, #0078d4);
    color: white;
    padding: 20px 24px;
    flex-shrink: 0;
}

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

.subscription-header p {
    margin: 4px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

/* FIXED: Triangle Limit Modal - GUARANTEED VISIBILITY */
.triangle-limit-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2100 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, system-ui, sans-serif !important;
}

.triangle-limit-modal-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
}

.triangle-limit-modal {
    background: linear-gradient(135deg, #2d2d30, #1a1a1a) !important;
    border: 2px solid #ff6b6b !important;
    border-radius: 20px !important;
    padding: 40px !important;
    max-width: 500px !important;
    width: 90% !important;
    color: white !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
    position: relative !important;
    transform: translateY(50px) scale(0.9);
    transition: all 0.3s ease;
}

.triangle-limit-modal-overlay.show .triangle-limit-modal {
    transform: translateY(0) scale(1) !important;
    animation: triangleLimitModalSlideIn 0.4s ease-out;
}

@keyframes triangleLimitModalSlideIn {
    from {
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.triangle-limit-header {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    margin-bottom: 30px !important;
    padding-bottom: 20px !important;
    border-bottom: 1px solid rgba(255, 107, 107, 0.25) !important;
}

.triangle-limit-icon {
    width: 60px !important;
    height: 60px !important;
    background: linear-gradient(135deg, #ff6b6b, #ff5252) !important;
    border-radius: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 28px !important;
    flex-shrink: 0 !important;
}

.triangle-limit-title {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin: 0 0 8px 0 !important;
}

.triangle-limit-subtitle {
    font-size: 16px !important;
    color: #cccccc !important;
    margin: 0 !important;
}

.triangle-limit-content {
    margin-bottom: 30px !important;
}

.triangle-limit-stats {
    background: #1a1a1a !important;
    border-radius: 12px !important;
    padding: 24px !important;
    margin-bottom: 24px !important;
    border: 1px solid #333333 !important;
}

.limit-stat {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 0 !important;
}

.limit-stat:not(:last-child) {
    border-bottom: 1px solid #333333 !important;
    margin-bottom: 16px !important;
}

.limit-label {
    font-size: 16px !important;
    color: #888888 !important;
    font-weight: 500 !important;
}

.limit-value {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #00d4aa !important;
}

.limit-value.exceeded {
    color: #ff6b6b !important;
}

.triangle-limit-message {
    font-size: 16px !important;
    color: #cccccc !important;
    line-height: 1.6 !important;
    margin-bottom: 24px !important;
    text-align: center !important;
}

.triangle-limit-benefits {
    background: #252525 !important;
    border-radius: 12px !important;
    padding: 20px !important;
    border: 1px solid #333 !important;
}

.triangle-limit-benefits h4 {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #00d4aa !important;
    margin: 0 0 12px 0 !important;
}

.triangle-limit-benefits ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #cccccc !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.triangle-limit-benefits li {
    margin-bottom: 6px !important;
}

.triangle-limit-benefits li:last-child {
    margin-bottom: 0 !important;
}

/* CRITICAL: Direct Triangle Modal (Ultimate Fallback) */
.direct-triangle-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2147483647 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    color: white !important;
}

/* Enhanced Button Styles for Triangle Modal */
.triangle-limit-modal .modal-buttons,
.triangle-limit-modal .modal-btn {
    /* Ensure buttons are properly styled */
}

.triangle-limit-modal .modal-btn {
    padding: 16px 24px !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

.triangle-limit-modal .modal-btn-secondary {
    background: #333333 !important;
    color: white !important;
    border: 2px solid #444444 !important;
}

.triangle-limit-modal .modal-btn-secondary:hover {
    background: #404040 !important;
    border-color: #555555 !important;
}

.triangle-limit-modal .modal-btn-primary {
    background: linear-gradient(135deg, #00d4aa, #0078d4) !important;
    color: #000 !important;
    border: none !important;
}

.triangle-limit-modal .modal-btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(0, 212, 170, 0.4) !important;
}

/* Responsive Design for Triangle Modal */
@media (max-width: 768px) {
    .triangle-limit-modal {
        padding: 30px 24px !important;
        margin: 20px !important;
        max-width: none !important;
        width: calc(100% - 40px) !important;
    }
    
    .triangle-limit-header {
        gap: 16px !important;
        margin-bottom: 24px !important;
        padding-bottom: 16px !important;
    }
    
    .triangle-limit-icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 24px !important;
    }
    
    .triangle-limit-title {
        font-size: 20px !important;
    }
    
    .triangle-limit-subtitle {
        font-size: 14px !important;
    }
    
    .limit-stat {
        flex-direction: column !important;
        gap: 8px !important;
        text-align: center !important;
    }
    
    .modal-buttons {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .modal-btn {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .triangle-limit-modal {
        padding: 24px 20px !important;
        margin: 10px !important;
        width: calc(100% - 20px) !important;
    }
    
    .triangle-limit-title {
        font-size: 18px !important;
    }
    
    .limit-value {
        font-size: 18px !important;
    }
    
    .triangle-limit-message {
        font-size: 14px !important;
    }
}

.triangle-limit-modal-overlay.show {
    /* Confirm modal is visible */
    box-shadow: inset 0 0 0 2px rgba(0, 255, 0, 0.1);
}
/* Model Explorer - Blender-style mesh hierarchy */
.model-explorer {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.3;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333333;
}

.model-explorer-header {
    background: #2a2a2a;
    padding: 8px 12px;
    border-bottom: 1px solid #333333;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cccccc;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-explorer-header i {
    color: #00d4aa;
    font-size: 14px;
}

.model-tree {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #555555 #2a2a2a;
}

.model-tree::-webkit-scrollbar {
    width: 6px;
}

.model-tree::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.model-tree::-webkit-scrollbar-thumb {
    background: #555555;
    border-radius: 3px;
}

.model-tree::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid transparent;
    position: relative;
}

.tree-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.tree-item.selected {
    background: rgba(0, 212, 170, 0.2);
    border-bottom-color: #00d4aa;
}

.tree-item.selected:hover {
    background: rgba(0, 212, 170, 0.3);
}

/* Indentation for hierarchy levels */
.tree-item[data-level="0"] { padding-left: 8px; }
.tree-item[data-level="1"] { padding-left: 24px; }
.tree-item[data-level="2"] { padding-left: 40px; }
.tree-item[data-level="3"] { padding-left: 56px; }

.tree-expand {
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    color: #888888;
    font-size: 10px;
    transition: transform 0.15s ease;
    cursor: pointer;
}

.tree-expand:hover {
    color: #cccccc;
}

.tree-expand.expanded {
    transform: rotate(90deg);
}

.tree-expand.empty {
    visibility: hidden;
}

.tree-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 14px;
    flex-shrink: 0;
}

.tree-icon.model {
    color: #ff6b6b;
}

.tree-icon.mesh {
    color: #4ecdc4;
}

.tree-icon.object {
    color: #ffeb3b;
}

.tree-icon.material {
    color: #ff9800;
}

.tree-label {
    flex: 1;
    color: #e0e0e0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

.tree-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.tree-item:hover .tree-actions {
    opacity: 1;
}

.tree-action {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888888;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s ease;
    font-size: 11px;
}

.tree-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #cccccc;
}

.tree-action.visibility {
    color: #00d4aa;
}

.tree-action.visibility.hidden {
    color: #666666;
}

.tree-action.focus {
    color: #ffab40;
}

.tree-stats {
    font-size: 11px;
    color: #888888;
    margin-left: auto;
    padding-left: 8px;
    font-weight: 500;
}

.tree-item.selected .tree-stats {
    color: #cccccc;
}

/* Loading state */
.model-explorer-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #888888;
    font-size: 12px;
    font-style: italic;
}

.model-explorer-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #333333;
    border-top: 2px solid #00d4aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* Empty state */
.model-explorer-empty {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-style: italic;
}

/* Context menu styling */
.model-context-menu {
    position: absolute;
    background: #2a2a2a;
    border: 1px solid #444444;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    padding: 4px 0;
    min-width: 120px;
    z-index: 1000;
    font-size: 12px;
}

.context-menu-item {
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu-item:hover {
    background: rgba(0, 212, 170, 0.2);
}

.context-menu-item i {
    width: 14px;
    font-size: 11px;
    color: #888888;
}

.context-menu-item:hover i {
    color: #00d4aa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .model-tree {
        max-height: 200px;
    }
    
    .tree-label {
        font-size: 12px;
    }
    
    .tree-stats {
        display: none;
    }
}

/* Model comparison view */
.model-explorer.comparison {
    border-left: 3px solid #00d4aa;
}

.model-explorer.comparison .model-explorer-header {
    background: linear-gradient(135deg, #2a2a2a, #1a3a30);
}

/* Animation for expanding/collapsing */
.tree-children {
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}

.tree-children.collapsed {
    max-height: 0;
}

.tree-children.expanded {
    max-height: 500px;
}
/* Add these styles to your existing CSS file */

/* License input wrapper for password field */
.license-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* License key input with space for toggle button */
.license-key-input {
    padding-right: 45px !important;
}

/* Toggle button for showing/hiding license key */
.license-key-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.license-key-toggle:hover {
    color: #00d4aa;
    background: rgba(0, 212, 170, 0.1);
}

.license-key-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.3);
}

.license-key-toggle i {
    font-size: 18px;
    line-height: 1;
}

/* Ensure the input field styling remains consistent */
.license-input {
    width: 100%;
    padding: 12px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.license-input:focus {
    outline: none;
    border-color: #00d4aa;
    background: #1f1f1f;
}

/* Optional: Add monospace font for license key when visible */
.license-key-input[type="text"] {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    letter-spacing: 0.5px;
}