/* Modal Styles */
.stl-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.stl-modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.stl-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

.stl-modal-header h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.stl-close {
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0 5px;
}

.stl-close:hover,
.stl-close:focus {
    color: #ffeb3b;
    transform: rotate(90deg);
}

.stl-modal-body {
    flex: 1;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

#stl-viewer-container {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

#stl-viewer-container canvas {
    display: block;
    outline: none;
}

#stl-loading,
#stl-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #666;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#stl-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#stl-error {
    color: #d32f2f;
    background: #ffebee;
    border: 2px solid #ef5350;
}

.stl-modal-footer {
    padding: 15px 30px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

.stl-controls-info {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.stl-controls-info span {
    color: #666;
    font-size: 13px;
    padding: 8px 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stl-modal-content {
        width: 95%;
        height: 90vh;
        margin: 5% auto;
    }
    
    .stl-modal-header {
        padding: 15px 20px;
    }
    
    .stl-modal-header h2 {
        font-size: 18px;
    }
    
    .stl-modal-body {
        padding: 10px;
    }
    
    .stl-controls-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .stl-controls-info span {
        font-size: 11px;
        padding: 6px 10px;
        text-align: center;
    }
}

/* Add loading animation for better UX */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.stl-modal {
    animation: fadeIn 0.3s ease;
}
